Staging: hv: vmbus: Introduce read dependency in hv_get_ringbuffer_availbytes()
authorK. Y. Srinivasan <kys@microsoft.com>
Mon, 6 Jun 2011 22:49:52 +0000 (15:49 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Jun 2011 20:45:55 +0000 (13:45 -0700)
Introduce read dependency in hv_get_ringbuffer_availbytes().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/ring_buffer.c

index 932af1a01a1ef3b561540738c29a754dfa6faa56..8b625533fe43bd1f36f862c9a0ae69dfbde49f73 100644 (file)
@@ -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;