summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-11-07 23:02:04 +0100
committerBjorn Helgaas <bhelgaas@google.com>2013-11-07 23:02:04 +0100
commiteaaeb1cb33310dea6c3fa45d8bfc63e5a1d0a846 (patch)
treea76b60ff193a29b521e1bd63943a6d1969fe9af4 /drivers/pci/pci.c
parentMerge branch 'pci/misc' into next (diff)
parentPCI: Enable upstream bridges even for VFs on virtual buses (diff)
downloadlinux-eaaeb1cb33310dea6c3fa45d8bfc63e5a1d0a846.tar.xz
linux-eaaeb1cb33310dea6c3fa45d8bfc63e5a1d0a846.zip
Merge branch 'pci/misc' into next
* pci/misc: PCI: Enable upstream bridges even for VFs on virtual buses PCI: Add pci_upstream_bridge() PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e485d92b3fa8..b127fbda6fc8 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1148,12 +1148,12 @@ int pci_reenable_device(struct pci_dev *dev)
static void pci_enable_bridge(struct pci_dev *dev)
{
+ struct pci_dev *bridge;
int retval;
- if (!dev)
- return;
-
- pci_enable_bridge(dev->bus->self);
+ bridge = pci_upstream_bridge(dev);
+ if (bridge)
+ pci_enable_bridge(bridge);
if (pci_is_enabled(dev)) {
if (!dev->is_busmaster)
@@ -1170,6 +1170,7 @@ static void pci_enable_bridge(struct pci_dev *dev)
static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
{
+ struct pci_dev *bridge;
int err;
int i, bars = 0;
@@ -1188,7 +1189,9 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
if (atomic_inc_return(&dev->enable_cnt) > 1)
return 0; /* already enabled */
- pci_enable_bridge(dev->bus->self);
+ bridge = pci_upstream_bridge(dev);
+ if (bridge)
+ pci_enable_bridge(bridge);
/* only skip sriov related */
for (i = 0; i <= PCI_ROM_RESOURCE; i++)