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 <k...@microsoft.com>
Cc: Haiyang Zhang <haiya...@microsoft.com>
Signed-off-by: Jason Wang <jasow...@redhat.com>
---
 drivers/hv/ring_buffer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 791f45d..26c93cf 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)
        if (rbi->ring_buffer->interrupt_mask)
                return false;
 
+       /* check interrupt_mask before read_index */
+       rmb();
        /*
         * This is the only case we need to signal when the
         * ring transitions from being empty to non-empty.
-- 
1.7.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to