]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
virtio_blk: quiesce/unquiesce live IO when entering PM states
authorSagi Grimberg <sagi@grimberg.me>
Tue, 4 Jul 2017 07:03:03 +0000 (10:03 +0300)
committerSagi Grimberg <sagi@grimberg.me>
Thu, 6 Jul 2017 06:49:34 +0000 (09:49 +0300)
Without it its not guaranteed that no .queue_rq is inflight.

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Cc: virtio-dev@lists.oasis-open.org
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/block/virtio_blk.c

index 0297ad7c1452a0985963ce5655869ed061809b09..4e02aa5fdac053dfa254fb05aac1b2c252e4c1be 100644 (file)
@@ -840,7 +840,7 @@ static int virtblk_freeze(struct virtio_device *vdev)
        /* Make sure no work handler is accessing the device. */
        flush_work(&vblk->config_work);
 
-       blk_mq_stop_hw_queues(vblk->disk->queue);
+       blk_mq_quiesce_queue(vblk->disk->queue);
 
        vdev->config->del_vqs(vdev);
        return 0;
@@ -857,7 +857,7 @@ static int virtblk_restore(struct virtio_device *vdev)
 
        virtio_device_ready(vdev);
 
-       blk_mq_start_stopped_hw_queues(vblk->disk->queue, true);
+       blk_mq_unquiesce_queue(vblk->disk->queue);
        return 0;
 }
 #endif