Skip to content

Commit

Permalink
virtio: console: Disable callbacks for virtqueues at start of S4 freeze
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Shah authored and Rusty Russell committed Jan 12, 2012
1 parent 2b8f41d commit c743d09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c743d09

Please sign in to comment.