diff options
| author | Bjorn Helgaas <bhelgaas@google.com> | 2026-02-07 02:09:17 +0300 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-02-07 02:09:17 +0300 |
| commit | 1cb15d2054064b554e31993fe72b9e93233cb10a (patch) | |
| tree | 50b4899ef510ffb3c959ae9c2902a45b643c2de3 | |
| parent | a89fdcb98ac82675879f43b9dfe69ba16be01255 (diff) | |
| parent | a5338e365c4559d7b4d7356116b0eb95b12e08d5 (diff) | |
| download | linux-1cb15d2054064b554e31993fe72b9e93233cb10a.tar.xz | |
Merge branch 'pci/iov'
* pci/iov:
PCI/IOV: Fix race between SR-IOV enable/disable and hotplug
Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV"
| -rw-r--r-- | drivers/pci/iov.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 00784a60ba80..4a659c34935e 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -495,7 +495,9 @@ static ssize_t sriov_numvfs_store(struct device *dev, if (num_vfs == 0) { /* disable VFs */ + pci_lock_rescan_remove(); ret = pdev->driver->sriov_configure(pdev, 0); + pci_unlock_rescan_remove(); goto exit; } @@ -507,7 +509,9 @@ static ssize_t sriov_numvfs_store(struct device *dev, goto exit; } + pci_lock_rescan_remove(); ret = pdev->driver->sriov_configure(pdev, num_vfs); + pci_unlock_rescan_remove(); if (ret < 0) goto exit; @@ -629,18 +633,15 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs) if (dev->no_vf_scan) return 0; - pci_lock_rescan_remove(); for (i = 0; i < num_vfs; i++) { rc = pci_iov_add_virtfn(dev, i); if (rc) goto failed; } - pci_unlock_rescan_remove(); return 0; failed: while (i--) pci_iov_remove_virtfn(dev, i); - pci_unlock_rescan_remove(); return rc; } @@ -765,10 +766,8 @@ static void sriov_del_vfs(struct pci_dev *dev) struct pci_sriov *iov = dev->sriov; int i; - pci_lock_rescan_remove(); for (i = 0; i < iov->num_VFs; i++) pci_iov_remove_virtfn(dev, i); - pci_unlock_rescan_remove(); } static void sriov_disable(struct pci_dev *dev) |
