From: K. Y. Srinivasan Date: Mon, 6 Jun 2011 22:49:52 +0000 (-0700) Subject: Staging: hv: vmbus: Introduce read dependency in hv_get_ringbuffer_availbytes() X-Git-Tag: next-20110726~5^2~568^2~54 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=df2a4a711478f5fc28b3ac85f07e191591e31eb0;p=karo-tx-linux.git Staging: hv: vmbus: Introduce read dependency in hv_get_ringbuffer_availbytes() Introduce read dependency in hv_get_ringbuffer_availbytes(). Signed-off-by: K. Y. Srinivasan Signed-off-by: Haiyang Zhang Signed-off-by: Abhishek Kane Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c index 932af1a01a1e..8b625533fe43 100644 --- a/drivers/staging/hv/ring_buffer.c +++ b/drivers/staging/hv/ring_buffer.c @@ -50,6 +50,8 @@ hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi, { u32 read_loc, write_loc; + smp_read_barrier_depends(); + /* Capture the read/write indices before they changed */ read_loc = rbi->ring_buffer->read_index; write_loc = rbi->ring_buffer->write_index;