aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-01-26 19:27:36 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-01-26 19:27:36 -0500
commit14b5cb37cc6172a54ce920c61784f44422ae306d (patch)
tree53e500c8aec98e645079e025c2525ce399052e1d /drivers/pci/pci.c
parent708b59bfe1d1727451ca41f5dc4c17cf99dfaf51 (diff)
parentfcbed0bcb216b9f134e8614f46e00649a179e042 (diff)
Merge branch 'pci/yijing-ari' into next
* pci/yijing-ari: PCI: shpchp: Iterate over all devices in slot, not functions 0-7 PCI: sgihp: Iterate over all devices in slot, not functions 0-7 PCI: cpcihp: Iterate over all devices in slot, not functions 0-7 PCI: pciehp: Iterate over all devices in slot, not functions 0-7 PCI: Consolidate "next-function" functions PCI: Rename pci_enable_ari() to pci_configure_ari() PCI: Enable ARI if dev and upstream bridge support it; disable otherwise
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 89dc8ac096ba..177a50ff6454 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2042,10 +2042,13 @@ void pci_free_cap_save_buffers(struct pci_dev *dev)
2042} 2042}
2043 2043
2044/** 2044/**
2045 * pci_enable_ari - enable ARI forwarding if hardware support it 2045 * pci_configure_ari - enable or disable ARI forwarding
2046 * @dev: the PCI device 2046 * @dev: the PCI device
2047 *
2048 * If @dev and its upstream bridge both support ARI, enable ARI in the
2049 * bridge. Otherwise, disable ARI in the bridge.
2047 */ 2050 */
2048void pci_enable_ari(struct pci_dev *dev) 2051void pci_configure_ari(struct pci_dev *dev)
2049{ 2052{
2050 u32 cap; 2053 u32 cap;
2051 struct pci_dev *bridge; 2054 struct pci_dev *bridge;
@@ -2053,9 +2056,6 @@ void pci_enable_ari(struct pci_dev *dev)
2053 if (pcie_ari_disabled || !pci_is_pcie(dev) || dev->devfn) 2056 if (pcie_ari_disabled || !pci_is_pcie(dev) || dev->devfn)
2054 return; 2057 return;
2055 2058
2056 if (!pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI))
2057 return;
2058
2059 bridge = dev->bus->self; 2059 bridge = dev->bus->self;
2060 if (!bridge) 2060 if (!bridge)
2061 return; 2061 return;
@@ -2064,8 +2064,15 @@ void pci_enable_ari(struct pci_dev *dev)
2064 if (!(cap & PCI_EXP_DEVCAP2_ARI)) 2064 if (!(cap & PCI_EXP_DEVCAP2_ARI))
2065 return; 2065 return;
2066 2066
2067 pcie_capability_set_word(bridge, PCI_EXP_DEVCTL2, PCI_EXP_DEVCTL2_ARI); 2067 if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI)) {
2068 bridge->ari_enabled = 1; 2068 pcie_capability_set_word(bridge, PCI_EXP_DEVCTL2,
2069 PCI_EXP_DEVCTL2_ARI);
2070 bridge->ari_enabled = 1;
2071 } else {
2072 pcie_capability_clear_word(bridge, PCI_EXP_DEVCTL2,
2073 PCI_EXP_DEVCTL2_ARI);
2074 bridge->ari_enabled = 0;
2075 }
2069} 2076}
2070 2077
2071/** 2078/**