From: Amit Shah <amit.shah@redhat.com>
To: stable@vger.kernel.org
Cc: Amos Kong <akong@redhat.com>,
Virtualization List <virtualization@lists.linux-foundation.org>,
linux-kernel@vger.kernel.org,
Rusty Russell <rusty@rustcorp.com.au>,
Amit Shah <amit.shah@redhat.com>
Subject: [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup
Date: Mon, 11 Aug 2014 18:11:47 +0530 [thread overview]
Message-ID: <5ef3aa4ea1932b7655d9db5a0139b8a2922af0db.1407760907.git.amit.shah@redhat.com> (raw)
This is a 3.16-only patch. The linux.git fix is
5c06273401f2eb7b290cadbae18ee00f8f65e893, which fixes this issue in a
different way.
Amos reported using multiple virtio-rng devices cause boot to freeze
even after the recent fixes. We need the probe_done test per device
rather than just once for the driver.
Reported-by: Amos Kong <akong@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
drivers/char/hw_random/virtio-rng.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index e9b15bc..124cac5 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -34,12 +34,11 @@ struct virtrng_info {
unsigned int data_avail;
struct completion have_data;
bool busy;
+ bool probe_done;
char name[25];
int index;
};
-static bool probe_done;
-
static void random_recv_done(struct virtqueue *vq)
{
struct virtrng_info *vi = vq->vdev->priv;
@@ -73,7 +72,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait)
* Don't ask host for data till we're setup. This call can
* happen during hwrng_register(), after commit d9e7972619.
*/
- if (unlikely(!probe_done))
+ if (unlikely(!vi->probe_done))
return 0;
if (!vi->busy) {
@@ -146,7 +145,7 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- probe_done = true;
+ vi->probe_done = true;
return 0;
}
--
1.9.3
next reply other threads:[~2014-08-11 12:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-11 12:41 Amit Shah [this message]
2014-08-11 22:55 ` [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup Greg KH
2014-08-12 5:31 ` Amit Shah
2014-08-12 5:55 ` Greg KH
2014-08-12 6:53 ` Amit Shah
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=5ef3aa4ea1932b7655d9db5a0139b8a2922af0db.1407760907.git.amit.shah@redhat.com \
--to=amit.shah@redhat.com \
--cc=akong@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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).