]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/pci/iov.c
Merge tag 'reset-fixes-for-4.14' of git://git.pengutronix.de/git/pza/linux into fixes
[mirror_ubuntu-bionic-kernel.git] / drivers / pci / iov.c
index 120485d6f352bf017199aee85b78507b3f2c38b7..ac41c8be9200accd30e91938aea8ed896dac1ec0 100644 (file)
@@ -331,7 +331,6 @@ failed:
        while (i--)
                pci_iov_remove_virtfn(dev, i, 0);
 
-       pcibios_sriov_disable(dev);
 err_pcibios:
        iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
        pci_cfg_access_lock(dev);
@@ -339,6 +338,8 @@ err_pcibios:
        ssleep(1);
        pci_cfg_access_unlock(dev);
 
+       pcibios_sriov_disable(dev);
+
        if (iov->link != dev->devfn)
                sysfs_remove_link(&dev->dev.kobj, "dep_link");
 
@@ -357,14 +358,14 @@ static void sriov_disable(struct pci_dev *dev)
        for (i = 0; i < iov->num_VFs; i++)
                pci_iov_remove_virtfn(dev, i, 0);
 
-       pcibios_sriov_disable(dev);
-
        iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
        pci_cfg_access_lock(dev);
        pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
        ssleep(1);
        pci_cfg_access_unlock(dev);
 
+       pcibios_sriov_disable(dev);
+
        if (iov->link != dev->devfn)
                sysfs_remove_link(&dev->dev.kobj, "dep_link");