summaryrefslogtreecommitdiffstats
path: root/drivers/char/virtio_console.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2012-01-06 16:19:08 +0530
committerRusty Russell <rusty@rustcorp.com.au>2012-01-12 15:44:45 +1030
commitc743d09dbd018dd6345519fb3264b16bdaa41746 (patch)
treeacf5eabccb93d35035547fd80489f222a1538256 /drivers/char/virtio_console.c
parent2b8f41d846990c3c1c8addbaed2cf53c3ef91d25 (diff)
virtio: console: Disable callbacks for virtqueues at start of S4 freeze
To ensure we don't receive any more interrupts from the host after we enter the freeze function, disable all vq interrupts. There wasn't any problem seen due to this in tests, but applying this patch makes the freeze case more robust. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r--drivers/char/virtio_console.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 614b84d38d7..b58b5618706 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1854,10 +1854,18 @@ static int virtcons_freeze(struct virtio_device *vdev)
vdev->config->reset(vdev);
+ virtqueue_disable_cb(portdev->c_ivq);
cancel_work_sync(&portdev->control_work);
+ /*
+ * Once more: if control_work_handler() was running, it would
+ * enable the cb as the last step.
+ */
+ virtqueue_disable_cb(portdev->c_ivq);
remove_controlq_data(portdev);
list_for_each_entry(port, &portdev->ports, list) {
+ virtqueue_disable_cb(port->in_vq);
+ virtqueue_disable_cb(port->out_vq);
/*
* We'll ask the host later if the new invocation has
* the port opened or closed.