iommu/arm-smmu: request pcie devices to enable ACS
authorWei Chen <Wei.Chen@arm.com>
Mon, 13 Jun 2016 09:20:17 +0000 (17:20 +0800)
committerWill Deacon <will.deacon@arm.com>
Fri, 1 Jul 2016 13:04:36 +0000 (14:04 +0100)
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>
drivers/iommu/arm-smmu-v3.c
drivers/iommu/arm-smmu.c

index 94b68213c50dae945b9c0789afe8b6465dfd5411..30ea8994554372480466b5ba84fcb3462acdc837 100644 (file)
@@ -2686,6 +2686,8 @@ static int __init arm_smmu_init(void)
        if (ret)
                return ret;
 
+       pci_request_acs();
+
        return bus_set_iommu(&pci_bus_type, &arm_smmu_ops);
 }
 
index 9345a3fcb706dc00ce0e202ab87f2ddc64078fee..ab365ec6184d919b9f259eae721b5f51bd3af487 100644 (file)
@@ -2096,8 +2096,10 @@ static int __init arm_smmu_init(void)
 #endif
 
 #ifdef CONFIG_PCI
-       if (!iommu_present(&pci_bus_type))
+       if (!iommu_present(&pci_bus_type)) {
+               pci_request_acs();
                bus_set_iommu(&pci_bus_type, &arm_smmu_ops);
+       }
 #endif
 
        return 0;
This page took 0.030444 seconds and 5 git commands to generate.