mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KY Srinivasan <kys@microsoft.com>
To: Jason Wang <jasowang@redhat.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Subject: RE: [PATCH] drivers: hv: check interrupt mask before read_index
Date: Thu, 20 Jun 2013 17:25:13 +0000	[thread overview]
Message-ID: <76e017c2579443f39c5fe5f2bdd169b7@SN2PR03MB061.namprd03.prod.outlook.com> (raw)
In-Reply-To: <1371704337-46108-1-git-send-email-jasowang@redhat.com>



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



      reply	other threads:[~2013-06-20 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  4:58 Jason Wang
2013-06-20 17:25 ` KY Srinivasan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76e017c2579443f39c5fe5f2bdd169b7@SN2PR03MB061.namprd03.prod.outlook.com \
    --to=kys@microsoft.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®