Thread (40 messages) 40 messages, 6 authors, 2014-11-11
STALE4221d REVIEWED: 1 (0M)
Revisions (7)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v2 [diff vs current]
  4. v3 [diff vs current]
  5. v3 [diff vs current]
  6. v4 current
  7. v4 [diff vs current]

[PATCH v4 12/25] virtio_blk: enable VQs early

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2014-10-13 07:47:32
Also in: kvm, linux-s390, linux-scsi, lkml
Subsystem: block layer, the rest, virtio block and scsi drivers, virtio core · Maintainers: Jens Axboe, Linus Torvalds, "Michael S. Tsirkin", Jason Wang

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 <redacted>
---
 drivers/block/virtio_blk.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 89ba8d6..46b04bf 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)
-- 
MST
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help