Skip to content

Commit 1082650

Browse files
committed
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio fixes from Michael Tsirkin: "The biggest thing here is the adminq change - but it looks like the only way to avoid headq blocking causing indefinite stalls. This fixes three issues: - Prevent admin commands on one VF blocking another. This prevents a bad VF from blocking a good one, as well as fixing a scalability issue with large # of VFs - Correctly return error on command failure on octeon. We used to treat failed commands as a success. - Fix modpost warning when building virtio_dma_buf. Harmless, but the fix is trivial" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio_pci_modern: remove admin queue serialization lock virtio_pci_modern: use completion instead of busy loop to wait on admin cmd result virtio_pci_modern: pass cmd as an identification token virtio_pci_modern: create admin queue of queried size virtio: create admin queues alongside other virtqueues virtio_pci: pass vq info as an argument to vp_setup_vq() virtio: push out code to vp_avq_index() virtio_pci_modern: treat vp_dev->admin_vq.info.vq pointer as static virtio_pci: introduce vector allocation fallback for slow path virtqueues virtio_pci: pass vector policy enum to vp_find_one_vq_msix() virtio_pci: pass vector policy enum to vp_find_vqs_msix() virtio_pci: simplify vp_request_msix_vectors() call a bit virtio_pci: push out single vq find code to vp_find_one_vq_msix() vdpa/octeon_ep: Fix error code in octep_process_mbox() virtio: add missing MODULE_DESCRIPTION() macro
2 parents cec6937 + 6d83469 commit 1082650

File tree

7 files changed

+240
-162
lines changed

7 files changed

+240
-162
lines changed

drivers/vdpa/octeon_ep/octep_vdpa_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int octep_process_mbox(struct octep_hw *oct_hw, u16 id, u16 qid, void *bu
140140
val = octep_read_sig(mbox);
141141
if ((val & 0xFFFF) != MBOX_RSP_SIG) {
142142
dev_warn(&pdev->dev, "Invalid Signature from mbox : %d response\n", id);
143-
return ret;
143+
return -EINVAL;
144144
}
145145

146146
val = octep_read_sts(mbox);

drivers/virtio/virtio.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,9 @@ static int virtio_dev_probe(struct device *_d)
305305
if (err)
306306
goto err;
307307

308-
if (dev->config->create_avq) {
309-
err = dev->config->create_avq(dev);
310-
if (err)
311-
goto err;
312-
}
313-
314308
err = drv->probe(dev);
315309
if (err)
316-
goto err_probe;
310+
goto err;
317311

318312
/* If probe didn't do it, mark device DRIVER_OK ourselves. */
319313
if (!(dev->config->get_status(dev) & VIRTIO_CONFIG_S_DRIVER_OK))
@@ -326,9 +320,6 @@ static int virtio_dev_probe(struct device *_d)
326320

327321
return 0;
328322

329-
err_probe:
330-
if (dev->config->destroy_avq)
331-
dev->config->destroy_avq(dev);
332323
err:
333324
virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED);
334325
return err;
@@ -344,9 +335,6 @@ static void virtio_dev_remove(struct device *_d)
344335

345336
drv->remove(dev);
346337

347-
if (dev->config->destroy_avq)
348-
dev->config->destroy_avq(dev);
349-
350338
/* Driver should have reset device. */
351339
WARN_ON_ONCE(dev->config->get_status(dev));
352340

@@ -524,9 +512,6 @@ int virtio_device_freeze(struct virtio_device *dev)
524512
}
525513
}
526514

527-
if (dev->config->destroy_avq)
528-
dev->config->destroy_avq(dev);
529-
530515
return 0;
531516
}
532517
EXPORT_SYMBOL_GPL(virtio_device_freeze);
@@ -562,16 +547,10 @@ int virtio_device_restore(struct virtio_device *dev)
562547
if (ret)
563548
goto err;
564549

565-
if (dev->config->create_avq) {
566-
ret = dev->config->create_avq(dev);
567-
if (ret)
568-
goto err;
569-
}
570-
571550
if (drv->restore) {
572551
ret = drv->restore(dev);
573552
if (ret)
574-
goto err_restore;
553+
goto err;
575554
}
576555

577556
/* If restore didn't do it, mark device DRIVER_OK ourselves. */
@@ -582,9 +561,6 @@ int virtio_device_restore(struct virtio_device *dev)
582561

583562
return 0;
584563

585-
err_restore:
586-
if (dev->config->destroy_avq)
587-
dev->config->destroy_avq(dev);
588564
err:
589565
virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED);
590566
return ret;

0 commit comments

Comments
 (0)