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 <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Signed-off-by:  K. Y. Srinivasan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Jason Wang 2013-06-20 12:58:57 +08:00 • committed by Greg Kroah-Hartman
commit e91e84fa4c

View file

@ -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.