aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-11-07 17:02:04 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-11-07 17:02:04 -0500
commiteaaeb1cb33310dea6c3fa45d8bfc63e5a1d0a846 (patch)
treea76b60ff193a29b521e1bd63943a6d1969fe9af4 /drivers/pci/pci.c
parentc245f2422031fec447e4d9e35fb0ef0fd5e42ab9 (diff)
parent79272138bd5c35edb9be5ae7b473a2741751a706 (diff)
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)
1148 1148
1149static void pci_enable_bridge(struct pci_dev *dev) 1149static void pci_enable_bridge(struct pci_dev *dev)
1150{ 1150{
1151 struct pci_dev *bridge;
1151 int retval; 1152 int retval;
1152 1153
1153 if (!dev) 1154 bridge = pci_upstream_bridge(dev);
1154 return; 1155 if (bridge)
1155 1156 pci_enable_bridge(bridge);
1156 pci_enable_bridge(dev->bus->self);
1157 1157
1158 if (pci_is_enabled(dev)) { 1158 if (pci_is_enabled(dev)) {
1159 if (!dev->is_busmaster) 1159 if (!dev->is_busmaster)
@@ -1170,6 +1170,7 @@ static void pci_enable_bridge(struct pci_dev *dev)
1170 1170
1171static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags) 1171static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
1172{ 1172{
1173 struct pci_dev *bridge;
1173 int err; 1174 int err;
1174 int i, bars = 0; 1175 int i, bars = 0;
1175 1176
@@ -1188,7 +1189,9 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
1188 if (atomic_inc_return(&dev->enable_cnt) > 1) 1189 if (atomic_inc_return(&dev->enable_cnt) > 1)
1189 return 0; /* already enabled */ 1190 return 0; /* already enabled */
1190 1191
1191 pci_enable_bridge(dev->bus->self); 1192 bridge = pci_upstream_bridge(dev);
1193 if (bridge)
1194 pci_enable_bridge(bridge);
1192 1195
1193 /* only skip sriov related */ 1196 /* only skip sriov related */
1194 for (i = 0; i <= PCI_ROM_RESOURCE; i++) 1197 for (i = 0; i <= PCI_ROM_RESOURCE; i++)