diff options
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r-- | drivers/pci/iov.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 120485d6f352..ac41c8be9200 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
@@ -331,7 +331,6 @@ failed: | |||
331 | while (i--) | 331 | while (i--) |
332 | pci_iov_remove_virtfn(dev, i, 0); | 332 | pci_iov_remove_virtfn(dev, i, 0); |
333 | 333 | ||
334 | pcibios_sriov_disable(dev); | ||
335 | err_pcibios: | 334 | err_pcibios: |
336 | iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE); | 335 | iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE); |
337 | pci_cfg_access_lock(dev); | 336 | pci_cfg_access_lock(dev); |
@@ -339,6 +338,8 @@ err_pcibios: | |||
339 | ssleep(1); | 338 | ssleep(1); |
340 | pci_cfg_access_unlock(dev); | 339 | pci_cfg_access_unlock(dev); |
341 | 340 | ||
341 | pcibios_sriov_disable(dev); | ||
342 | |||
342 | if (iov->link != dev->devfn) | 343 | if (iov->link != dev->devfn) |
343 | sysfs_remove_link(&dev->dev.kobj, "dep_link"); | 344 | sysfs_remove_link(&dev->dev.kobj, "dep_link"); |
344 | 345 | ||
@@ -357,14 +358,14 @@ static void sriov_disable(struct pci_dev *dev) | |||
357 | for (i = 0; i < iov->num_VFs; i++) | 358 | for (i = 0; i < iov->num_VFs; i++) |
358 | pci_iov_remove_virtfn(dev, i, 0); | 359 | pci_iov_remove_virtfn(dev, i, 0); |
359 | 360 | ||
360 | pcibios_sriov_disable(dev); | ||
361 | |||
362 | iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE); | 361 | iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE); |
363 | pci_cfg_access_lock(dev); | 362 | pci_cfg_access_lock(dev); |
364 | pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); | 363 | pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); |
365 | ssleep(1); | 364 | ssleep(1); |
366 | pci_cfg_access_unlock(dev); | 365 | pci_cfg_access_unlock(dev); |
367 | 366 | ||
367 | pcibios_sriov_disable(dev); | ||
368 | |||
368 | if (iov->link != dev->devfn) | 369 | if (iov->link != dev->devfn) |
369 | sysfs_remove_link(&dev->dev.kobj, "dep_link"); | 370 | sysfs_remove_link(&dev->dev.kobj, "dep_link"); |
370 | 371 | ||