From: Jason Wang <jasowang@redhat.com>
To: kys@microsoft.com, devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org
Cc: haiyangz@microsoft.com, Jason Wang <jasowang@redhat.com>
Subject: [PATCH] drivers: hv: check interrupt mask before read_index
Date: Thu, 20 Jun 2013 12:58:57 +0800 [thread overview]
Message-ID: <1371704337-46108-1-git-send-email-jasowang@redhat.com> (raw)
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
next reply other threads:[~2013-06-20 5:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 4:58 Jason Wang [this message]
2013-06-20 17:25 ` [PATCH] drivers: hv: check interrupt mask before read_index KY Srinivasan
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=1371704337-46108-1-git-send-email-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.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;
as well as URLs for NNTP newsgroup(s).