aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv/ring_buffer.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-06-20 00:58:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-24 19:24:17 -0400
commite91e84fa4cfeb67a9a096f1adaa1a1a692474724 (patch)
tree7e36ab11890da81a89817e2b24e85cc11b480b83 /drivers/hv/ring_buffer.c
parent0686ab7a7d05cda3373e311a49b2478bd4f03c5d (diff)
drivers: hv: check interrupt mask before read_index
This patches add a read barriers to force the driver to check the interrupt mask before read_index. Otherwise we may lost a kick to host. Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/ring_buffer.c')
-rw-r--r--drivers/hv/ring_buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 791f45dfc85d..26c93cf9f6be 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -75,6 +75,8 @@ static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi)
75 if (rbi->ring_buffer->interrupt_mask) 75 if (rbi->ring_buffer->interrupt_mask)
76 return false; 76 return false;
77 77
78 /* check interrupt_mask before read_index */
79 rmb();
78 /* 80 /*
79 * This is the only case we need to signal when the 81 * This is the only case we need to signal when the
80 * ring transitions from being empty to non-empty. 82 * ring transitions from being empty to non-empty.