* [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup
@ 2014-08-11 12:41 Amit Shah
2014-08-11 22:55 ` Greg KH
[not found] ` <20140811225527.GB10721@kroah.com>
0 siblings, 2 replies; 5+ messages in thread
From: Amit Shah @ 2014-08-11 12:41 UTC (permalink / raw)
To: stable; +Cc: Amit Shah, linux-kernel, Virtualization List
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup
2014-08-11 12:41 [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup Amit Shah
@ 2014-08-11 22:55 ` Greg KH
[not found] ` <20140811225527.GB10721@kroah.com>
1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-08-11 22:55 UTC (permalink / raw)
To: Amit Shah; +Cc: linux-kernel, stable, Virtualization List
On Mon, Aug 11, 2014 at 06:11:47PM +0530, Amit Shah wrote:
> This is a 3.16-only patch. The linux.git fix is
> 5c06273401f2eb7b290cadbae18ee00f8f65e893, which fixes this issue in a
> different way.
Why "different"? Why can't I take that original patch instead? What is
different in this patch, and why?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup
[not found] ` <20140811225527.GB10721@kroah.com>
@ 2014-08-12 5:31 ` Amit Shah
2014-08-12 5:55 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Amit Shah @ 2014-08-12 5:31 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, stable, Virtualization List
On (Tue) 12 Aug 2014 [06:55:27], Greg KH wrote:
> On Mon, Aug 11, 2014 at 06:11:47PM +0530, Amit Shah wrote:
> > This is a 3.16-only patch. The linux.git fix is
> > 5c06273401f2eb7b290cadbae18ee00f8f65e893, which fixes this issue in a
> > different way.
>
> Why "different"? Why can't I take that original patch instead? What is
> different in this patch, and why?
The commit referenced moves the hwrng_register() call to the ->scan()
callback instead of it being in probe(). This was done to ensure the
virtio-rng devices can contribute to the initial system entropy
introduced in commit d9e7972619334.
That patch is quite small too, but will need a slight conflict
resolution due to the previous two code-shuffling patches, and also
the following revert.
However, I decided against the backport of the ->scan() method, since
it wasn't designed to solve this regression, it happens to solve it,
and it actually introduces new functionality. I would be happy to
provide a backport of the relevant patches, if you think that would be
alright.
Thanks,
Amit
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup
2014-08-12 5:31 ` Amit Shah
@ 2014-08-12 5:55 ` Greg KH
2014-08-12 6:53 ` Amit Shah
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-08-12 5:55 UTC (permalink / raw)
To: Amit Shah; +Cc: linux-kernel, stable, Virtualization List
On Tue, Aug 12, 2014 at 11:01:58AM +0530, Amit Shah wrote:
> On (Tue) 12 Aug 2014 [06:55:27], Greg KH wrote:
> > On Mon, Aug 11, 2014 at 06:11:47PM +0530, Amit Shah wrote:
> > > This is a 3.16-only patch. The linux.git fix is
> > > 5c06273401f2eb7b290cadbae18ee00f8f65e893, which fixes this issue in a
> > > different way.
> >
> > Why "different"? Why can't I take that original patch instead? What is
> > different in this patch, and why?
>
> The commit referenced moves the hwrng_register() call to the ->scan()
> callback instead of it being in probe(). This was done to ensure the
> virtio-rng devices can contribute to the initial system entropy
> introduced in commit d9e7972619334.
>
> That patch is quite small too, but will need a slight conflict
> resolution due to the previous two code-shuffling patches, and also
> the following revert.
>
> However, I decided against the backport of the ->scan() method, since
> it wasn't designed to solve this regression, it happens to solve it,
> and it actually introduces new functionality. I would be happy to
> provide a backport of the relevant patches, if you think that would be
> alright.
I almost always want "original" patches as it causes less bugs overall,
and less confusion for everyone involved. Taking 2-3 patches is just as
easy as 1 patch, and even easier if I don't have to review it as "hard"
due to it not differing from what is in Linus's tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup
2014-08-12 5:55 ` Greg KH
@ 2014-08-12 6:53 ` Amit Shah
0 siblings, 0 replies; 5+ messages in thread
From: Amit Shah @ 2014-08-12 6:53 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, stable, Virtualization List
On (Tue) 12 Aug 2014 [13:55:48], Greg KH wrote:
> On Tue, Aug 12, 2014 at 11:01:58AM +0530, Amit Shah wrote:
> > On (Tue) 12 Aug 2014 [06:55:27], Greg KH wrote:
> > > On Mon, Aug 11, 2014 at 06:11:47PM +0530, Amit Shah wrote:
> > > > This is a 3.16-only patch. The linux.git fix is
> > > > 5c06273401f2eb7b290cadbae18ee00f8f65e893, which fixes this issue in a
> > > > different way.
> > >
> > > Why "different"? Why can't I take that original patch instead? What is
> > > different in this patch, and why?
> >
> > The commit referenced moves the hwrng_register() call to the ->scan()
> > callback instead of it being in probe(). This was done to ensure the
> > virtio-rng devices can contribute to the initial system entropy
> > introduced in commit d9e7972619334.
> >
> > That patch is quite small too, but will need a slight conflict
> > resolution due to the previous two code-shuffling patches, and also
> > the following revert.
> >
> > However, I decided against the backport of the ->scan() method, since
> > it wasn't designed to solve this regression, it happens to solve it,
> > and it actually introduces new functionality. I would be happy to
> > provide a backport of the relevant patches, if you think that would be
> > alright.
>
> I almost always want "original" patches as it causes less bugs overall,
> and less confusion for everyone involved. Taking 2-3 patches is just as
> easy as 1 patch, and even easier if I don't have to review it as "hard"
> due to it not differing from what is in Linus's tree.
Thanks; I'll send a backport of the patches, then.
Amit
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-12 6:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11 12:41 [3.16 stable PATCH 1/1] virtio-rng: fix multi-device startup Amit Shah
2014-08-11 22:55 ` Greg KH
[not found] ` <20140811225527.GB10721@kroah.com>
2014-08-12 5:31 ` Amit Shah
2014-08-12 5:55 ` Greg KH
2014-08-12 6:53 ` Amit Shah
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).