From: Michael S. Tsirkin Date: Tue, 14 Oct 2014 23:52:30 +0000 (+1030) Subject: virtio_blk: enable VQs early X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a11370e5e6c26566904bb7f08281093a3002ff2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git virtio_blk: enable VQs early 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 Reviewed-by: Cornelia Huck Signed-off-by: Rusty Russell --- diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 89ba8d6baa94..34ec273b1d46 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -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)