aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2009-12-04 15:15:21 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-12-04 19:19:24 -0500
commit5d990b627537e59a3a2f039ff588a4750e9c1a6a (patch)
tree8c0e723c3f9146da52b30c087a80fc417df2b41b /drivers/pci/pci.c
parentb26a34aa4792b3db2500b8a98cb7702765c1a92e (diff)
PCI: add pci_request_acs
Commit ae21ee65e8bc228416bbcc8a1da01c56a847a60c "PCI: acs p2p upsteram forwarding enabling" doesn't actually enable ACS. Add a function to pci core to allow an IOMMU to request that ACS be enabled. The existing mechanism of using iommu_found() in the pci core to know when ACS should be enabled doesn't actually work due to initialization order; iommu has only been detected not initialized. Have Intel and AMD IOMMUs request ACS, and Xen does as well during early init of dom0. Cc: Allen Kay <allen.m.kay@intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6af212c509c5..cd9b375f49d5 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1550,6 +1550,16 @@ void pci_enable_ari(struct pci_dev *dev)
1550 bridge->ari_enabled = 1; 1550 bridge->ari_enabled = 1;
1551} 1551}
1552 1552
1553static int pci_acs_enable;
1554
1555/**
1556 * pci_request_acs - ask for ACS to be enabled if supported
1557 */
1558void pci_request_acs(void)
1559{
1560 pci_acs_enable = 1;
1561}
1562
1553/** 1563/**
1554 * pci_enable_acs - enable ACS if hardware support it 1564 * pci_enable_acs - enable ACS if hardware support it
1555 * @dev: the PCI device 1565 * @dev: the PCI device
@@ -1560,6 +1570,9 @@ void pci_enable_acs(struct pci_dev *dev)
1560 u16 cap; 1570 u16 cap;
1561 u16 ctrl; 1571 u16 ctrl;
1562 1572
1573 if (!pci_acs_enable)
1574 return;
1575
1563 if (!pci_is_pcie(dev)) 1576 if (!pci_is_pcie(dev))
1564 return; 1577 return;
1565 1578