virtio-rng: make device ready before making request
Subsystems (3)
PATCH 1/1 virtio-rng: make device ready before making request
Current virtio-rng does a entropy request before DRIVER_OK, this violates the spec and kernel will ignore the interrupt after commit 8b4ec69d7e09 ("virtio: harden vring IRQ").
Fixing this by making device ready before the request.
Fixes 8b4ec69d7e09 ("virtio: harden vring IRQ")
Reported-and-tested-by [email protected]
Signed-off-by Jason Wang <[email protected]>
--- drivers/char/hw_random/virtio-rng.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/char/hw_random/virtio-rng.c +2 -0
@@ -159,6 +159,8 @@ static int probe_common(struct virtio_device *vdev) goto err_find; } +virtio_device_ready (vdev); +/* we always have a pending entropy request */ request_entropy (vi);
Signature · 1 line
2.25.1
Quoted 18 lines · Jason Wang
Current virtio-rng does a entropy request before
DRIVER_OK, this violates the spec and kernel will ignore the interrupt after commit8b4ec69d7e09("virtio: harden vring IRQ").Fixing this by making device ready before the request.
Fixes 8b4ec69d7e09 ("virtio: harden vring IRQ")Reported-and-tested-by [email protected]Signed-off-by Jason Wang <[email protected]>--- drivers/char/hw_random/virtio-rng.c | 2 ++ 1 file changed, 2 insertions(+)drivers/char/hw_random/virtio-rng.c +0
-0
drivers/char/hw_random/virtio-rng.c static int probe_common(struct virtio_device *vdev) · line 166
Quoted 8 lines
drivers/char/hw_random/virtio-rng.c +2
-0@@ -159,6 +159,8 @@ static int probe_common(struct virtio_device *vdev) goto err_find; } +virtio_device_ready (vdev); +/* we always have a pending entropy request */ request_entropy (vi);
Reviewed-by Laurent Vivier <[email protected]>