From: K. Y. Srinivasan Date: Fri, 29 Mar 2013 21:30:38 +0000 (-0700) Subject: Drivers: hv: vmbus: Fix a bug in hv_need_to_signal() X-Git-Tag: firefly_0821_release~3680^2~676^2~38 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=288fa3e022eb85fa151e0f9bcd15caeb81679af6;p=firefly-linux-kernel-4.4.55.git Drivers: hv: vmbus: Fix a bug in hv_need_to_signal() As part of updating the vmbus protocol, the function hv_need_to_signal() was introduced. This functions helps optimize signalling from guest to host. The newly added memory barrier is needed to ensure that we correctly decide when to signal the host. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang Reported-by: Olaf Hering Cc: Stable (V3.8+) Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index cafa72ffdc30..d6fbb5772b8d 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -71,6 +71,7 @@ u32 hv_end_read(struct hv_ring_buffer_info *rbi) static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi) { + smp_mb(); if (rbi->ring_buffer->interrupt_mask) return false;