linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: hv: check interrupt mask before read_index
@ 2013-06-20  4:58 Jason Wang
  2013-06-20 17:25 ` KY Srinivasan
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Wang @ 2013-06-20  4:58 UTC (permalink / raw)
  To: kys, devel, linux-kernel, gregkh; +Cc: haiyangz, Jason Wang

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] drivers: hv: check interrupt mask before read_index
  2013-06-20  4:58 [PATCH] drivers: hv: check interrupt mask before read_index Jason Wang
@ 2013-06-20 17:25 ` KY Srinivasan
  0 siblings, 0 replies; 2+ messages in thread
From: KY Srinivasan @ 2013-06-20 17:25 UTC (permalink / raw)
  To: Jason Wang, devel, linux-kernel, gregkh; +Cc: Haiyang Zhang



> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Thursday, June 20, 2013 12:59 AM
> To: KY Srinivasan; devel@linuxdriverproject.org; linux-kernel@vger.kernel.org;
> gregkh@linuxfoundation.org
> Cc: Haiyang Zhang; Jason Wang
> Subject: [PATCH] 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>
> ---
>  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
> 
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-20 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-20  4:58 [PATCH] drivers: hv: check interrupt mask before read_index Jason Wang
2013-06-20 17:25 ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).