aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6c93af5ced18..7b70312181d7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -846,6 +846,8 @@ pci_restore_state(struct pci_dev *dev)
846 int i; 846 int i;
847 u32 val; 847 u32 val;
848 848
849 if (!dev->state_saved)
850 return 0;
849 /* PCI Express register must be restored first */ 851 /* PCI Express register must be restored first */
850 pci_restore_pcie_state(dev); 852 pci_restore_pcie_state(dev);
851 853
@@ -1517,11 +1519,20 @@ void pci_enable_ari(struct pci_dev *dev)
1517 * 1519 *
1518 * Perform INTx swizzling for a device behind one level of bridge. This is 1520 * Perform INTx swizzling for a device behind one level of bridge. This is
1519 * required by section 9.1 of the PCI-to-PCI bridge specification for devices 1521 * required by section 9.1 of the PCI-to-PCI bridge specification for devices
1520 * behind bridges on add-in cards. 1522 * behind bridges on add-in cards. For devices with ARI enabled, the slot
1523 * number is always 0 (see the Implementation Note in section 2.2.8.1 of
1524 * the PCI Express Base Specification, Revision 2.1)
1521 */ 1525 */
1522u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin) 1526u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin)
1523{ 1527{
1524 return (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1; 1528 int slot;
1529
1530 if (pci_ari_enabled(dev->bus))
1531 slot = 0;
1532 else
1533 slot = PCI_SLOT(dev->devfn);
1534
1535 return (((pin - 1) + slot) % 4) + 1;
1525} 1536}
1526 1537
1527int 1538int
@@ -2171,7 +2182,7 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
2171 u16 ctrl; 2182 u16 ctrl;
2172 struct pci_dev *pdev; 2183 struct pci_dev *pdev;
2173 2184
2174 if (dev->subordinate) 2185 if (pci_is_root_bus(dev->bus) || dev->subordinate || !dev->bus->self)
2175 return -ENOTTY; 2186 return -ENOTTY;
2176 2187
2177 list_for_each_entry(pdev, &dev->bus->devices, bus_list) 2188 list_for_each_entry(pdev, &dev->bus->devices, bus_list)