All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-rng: complete have_data completion in removing device
@ 2014-08-05 17:35 ` Amos Kong
  0 siblings, 0 replies; 10+ messages in thread
From: Amos Kong @ 2014-08-05 17:35 UTC (permalink / raw)
  To: virtualization; +Cc: amit.shah, rusty, kvm, stable

When we try to hot-remove a busy virtio-rng device from QEMU monitor,
the device can't be hot-removed. Because virtio-rng driver hangs at
wait_for_completion_killable().

This patch fixed the hang by completing have_data completion before
unregistering a virtio-rng device.

Signed-off-by: Amos Kong <akong@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/char/hw_random/virtio-rng.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 0027137..416b15c 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -137,6 +137,7 @@ static void remove_common(struct virtio_device *vdev)
 	struct virtrng_info *vi = vdev->priv;
 
 	vdev->config->reset(vdev);
+	complete(&vi->have_data);
 	vi->busy = false;
 	if (vi->hwrng_register_done)
 		hwrng_unregister(&vi->hwrng);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-09-09 10:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 17:35 [PATCH] virtio-rng: complete have_data completion in removing device Amos Kong
2014-08-05 17:35 ` Amos Kong
2014-08-06  8:05 ` Amos Kong
2014-08-06  8:05   ` Amos Kong
2014-08-06  8:25   ` Amit Shah
2014-08-06  8:25     ` Amit Shah
2014-09-08 15:29     ` Amos Kong
2014-09-08 15:29       ` Amos Kong
2014-09-09 10:47       ` Amos Kong
2014-09-09 10:47         ` Amos Kong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.