]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
virtio_blk: enable VQs early
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 14 Oct 2014 23:52:30 +0000 (10:22 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 14 Oct 2014 23:55:02 +0000 (10:25 +1030)
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, virtio block violated this
rule by calling add_disk, which causes the VQ to be used directly within
probe.

To fix, call virtio_device_ready before using VQs.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c

index 89ba8d6baa94393ffdd3546e7744a3f1aec1ed2b..34ec273b1d4698d51f15240dc4ee09ee13bb1af1 100644 (file)
@@ -719,6 +719,8 @@ static int virtblk_probe(struct virtio_device *vdev)
        if (!err && opt_io_size)
                blk_queue_io_opt(q, blk_size * opt_io_size);
 
+       virtio_device_ready(vdev);
+
        add_disk(vblk->disk);
        err = device_create_file(disk_to_dev(vblk->disk), &dev_attr_serial);
        if (err)