From: Peter Hurley Date: Fri, 16 Jan 2015 20:05:37 +0000 (-0500) Subject: n_tty: Fix unordered accesses to lockless read buffer X-Git-Tag: fixes-v4.0-rc1~98^2~30 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70aca71f92ca2c111978bf676287fab5580d2598;p=pandora-kernel.git n_tty: Fix unordered accesses to lockless read buffer Add commit_head buffer index, which the producer-side publishes after input processing in non-canon mode. This ensures the consumer-side observes correctly-ordered writes in non-canonical mode (ie., the buffer data is written before the buffer index is advanced). Fix consumer-side uses of read_cnt() to use commit_head instead. Add required memory barriers to the tail index to guarantee the consumer-side has completed the loads before the producer-side begins writing new data. Open-code the producer-side receive_room() into the i/o loop. Remove no-longer-referenced receive_room(). Based on work by Christian Riesch Cc: Christian Riesch Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed