aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Chen <Wei.Chen@arm.com>2016-06-13 05:20:17 -0400
committerWill Deacon <will.deacon@arm.com>2016-07-01 09:04:36 -0400
commit112c898b59dd5cfd95ee30dfe7cc4fc11a6d484e (patch)
treea278cb60267b95efc989ac87c7348e487d6cbd36
parent560829b4f6c34adae82082fe86d21e7c6cdc4eaf (diff)
iommu/arm-smmu: request pcie devices to enable ACS
The PCIe ACS capability will affect the layout of iommu groups. Generally speaking, if the path from root port to the PCIe device is ACS enabled, the iommu will create a single iommu group for this PCIe device. If all PCIe devices on the path are ACS enabled then Linux can determine this path is ACS enabled. Linux use two PCIe configuration registers to determine the ACS status of PCIe devices: ACS Capability Register and ACS Control Register. The first register is used to check the implementation of ACS function of a PCIe device, the second register is used to check the enable status of ACS function. If one PCIe device has implemented and enabled the ACS function then Linux will determine this PCIe device enabled ACS. From the Chapter:6.12 of PCI Express Base Specification Revision 3.1a, we can find that when a PCIe device implements ACS function, the enable status is set to disabled by default and can be enabled by ACS-aware software. ACS will affect the iommu groups topology, so, the iommu driver is ACS-aware software. This patch adds a call to pci_request_acs() to the arm-smmu driver to enable the ACS function in PCIe devices that support it, when they get probed. Reviewed-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Wei Chen <Wei.Chen@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--drivers/iommu/arm-smmu-v3.c2
-rw-r--r--drivers/iommu/arm-smmu.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 94b68213c50d..30ea89945543 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -2686,6 +2686,8 @@ static int __init arm_smmu_init(void)
2686 if (ret) 2686 if (ret)
2687 return ret; 2687 return ret;
2688 2688
2689 pci_request_acs();
2690
2689 return bus_set_iommu(&pci_bus_type, &arm_smmu_ops); 2691 return bus_set_iommu(&pci_bus_type, &arm_smmu_ops);
2690} 2692}
2691 2693
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 9345a3fcb706..ab365ec6184d 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2096,8 +2096,10 @@ static int __init arm_smmu_init(void)
2096#endif 2096#endif
2097 2097
2098#ifdef CONFIG_PCI 2098#ifdef CONFIG_PCI
2099 if (!iommu_present(&pci_bus_type)) 2099 if (!iommu_present(&pci_bus_type)) {
2100 pci_request_acs();
2100 bus_set_iommu(&pci_bus_type, &arm_smmu_ops); 2101 bus_set_iommu(&pci_bus_type, &arm_smmu_ops);
2102 }
2101#endif 2103#endif
2102 2104
2103 return 0; 2105 return 0;