Skip to content

Commit eacea84

Browse files
vwaxmstsirkin
authored andcommitted
um: virt-pci: set device ready in probe()
Call virtio_device_ready() to make this driver work after commit b4ec69d7e09 ("virtio: harden vring IRQ"), since the driver uses the virtqueues in the probe function. (The virtio core sets the device ready when probe returns.) Fixes: 8b4ec69 ("virtio: harden vring IRQ") Fixes: 68f5d3f ("um: add PCI over virtio emulation driver") Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Message-Id: <20220610151203.3492541-1-vincent.whitchurch@axis.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Johannes Berg <johannes@sipsolutions.net>
1 parent 00d1f54 commit eacea84

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/um/drivers/virt-pci.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,8 @@ static int um_pci_init_vqs(struct um_pci_device *dev)
544544
dev->cmd_vq = vqs[0];
545545
dev->irq_vq = vqs[1];
546546

547+
virtio_device_ready(dev->vdev);
548+
547549
for (i = 0; i < NUM_IRQ_MSGS; i++) {
548550
void *msg = kzalloc(MAX_IRQ_MSG_SIZE, GFP_KERNEL);
549551

@@ -587,7 +589,7 @@ static int um_pci_virtio_probe(struct virtio_device *vdev)
587589
dev->irq = irq_alloc_desc(numa_node_id());
588590
if (dev->irq < 0) {
589591
err = dev->irq;
590-
goto error;
592+
goto err_reset;
591593
}
592594
um_pci_devices[free].dev = dev;
593595
vdev->priv = dev;
@@ -604,6 +606,9 @@ static int um_pci_virtio_probe(struct virtio_device *vdev)
604606

605607
um_pci_rescan();
606608
return 0;
609+
err_reset:
610+
virtio_reset_device(vdev);
611+
vdev->config->del_vqs(vdev);
607612
error:
608613
mutex_unlock(&um_pci_mtx);
609614
kfree(dev);

0 commit comments

Comments
 (0)