PCI ACS is broken for ARM SMMU v3?
Subsystems (3)
Hi Will and Alex,
pci_request_acs is called in drivers/iommu/arm-smmu-v3.c to set pci_acs_enable.
PCI subsystem tries to enable ACS as below:
pci_device_add --> pci_init_capabilities --> pci_enable_acs
in ACPI PCI driver. However, ACPI PCI driver will be called before SMMU v3 driver, which will lead pci_enable_acs to return directly as pci_acs_enable is not set before SMMU v3 driver loading.
I think this is a bug, what do you think about this problem?
Best,
Zhou
+to: Lorenzo
Quoted 25 lines · Zhou Wang
Hi Will and Alex,
pci_request_acsis called indrivers/iommu/arm-smmu-v3.cto setpci_acs_enable.PCI subsystem tries to enable ACS as below:
pci_device_add --> pci_init_capabilities --> pci_enable_acsin ACPI PCI driver. However, ACPI PCI driver will be called before SMMU v3 driver, which will lead
pci_enable_acsto return directly aspci_acs_enableis not set before SMMU v3 driver loading.I think this is a bug, what do you think about this problem?
Best,
Zhou.
Quoted 18 lines · Zhou Wang
+to: Lorenzo
Quoted 15 lines · Zhou Wang
Hi Will and Alex,
pci_request_acsis called indrivers/iommu/arm-smmu-v3.cto setpci_acs_enable.PCI subsystem tries to enable ACS as below:
pci_device_add --> pci_init_capabilities --> pci_enable_acsin ACPI PCI driver. However, ACPI PCI driver will be called before SMMU v3 driver, which will lead
pci_enable_acsto return directly aspci_acs_enableis not set before SMMU v3 driver loading.I think this is a bug, what do you think about this problem?
I think that it is a bug that affects OF/ACPI alike. One way of solving it is requesting ACS at IORT init following appropriate checks (ie mappings PCI->IOMMU - that would not solve the OF path though). I can put together a quick fix, the overall problem needs some thinking though.
Lorenzo
Quoted 14 lines · Lorenzo Pieralisi
Quoted 13 lines · Zhou Wang
+to: Lorenzo
Quoted 10 lines · Zhou Wang
Hi Will and Alex,
pci_request_acsis called indrivers/iommu/arm-smmu-v3.cto setpci_acs_enable.PCI subsystem tries to enable ACS as below:
pci_device_add --> pci_init_capabilities --> pci_enable_acs
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
in ACPI PCI driver. However, ACPI PCI driver will be called before SMMU v3 driver, which will lead
pci_enable_acsto return directly aspci_acs_enableis not set before SMMU v3 driver loading.I think this is a bug, what do you think about this problem?
I think that it is a bug that affects OF/ACPI alike. One way of solving
Yes, DT also has this problem.
Quoted 4 lines
it is requesting ACS at IORT init following appropriate checks (ie mappings
PCI->IOMMU- that would not solve the OF path though). I can put together a quick fix, the overall problem needs some thinking though.
I am not familiar with IORT init, but can we do it like:
drivers/acpi/arm64/iort.c +0 -0
@@ -1131,6 +1131,7 @@ static void __init iort_init_platform_devices(void)
acpi_free_fwnode_static(fwnode); return; } + pci_request_acs(); } iort_node = ACPI_ADD_PTR(struct acpi_iort_node, iort_node,
Best,
Zhou
Quoted 5 lines
Lorenzo
.
Quoted 38 lines · Zhou Wang
Quoted 14 lines · Lorenzo Pieralisi
Quoted 13 lines · Zhou Wang
+to: Lorenzo
Quoted 10 lines · Zhou Wang
Hi Will and Alex,
pci_request_acsis called indrivers/iommu/arm-smmu-v3.cto setpci_acs_enable.PCI subsystem tries to enable ACS as below:
pci_device_add --> pci_init_capabilities --> pci_enable_acsQuoted 7 lines
Quoted 5 lines
Quoted 5 lines
in ACPI PCI driver. However, ACPI PCI driver will be called before SMMU v3 driver, which will lead
pci_enable_acsto return directly aspci_acs_enableis not set before SMMU v3 driver loading.I think this is a bug, what do you think about this problem?
I think that it is a bug that affects OF/ACPI alike. One way of solving
Yes, DT also has this problem.
Quoted 4 lines
it is requesting ACS at IORT init following appropriate checks (ie mappings
PCI->IOMMU- that would not solve the OF path though). I can put together a quick fix, the overall problem needs some thinking though.I am not familiar with IORT init, but can we do it like:
drivers/acpi/arm64/iort.c +0
-0
drivers/acpi/arm64/iort.c static void __init iort_init_platform_devices(void) · line 1137
Quoted 7 lines
drivers/acpi/arm64/iort.c +1
-0@@ -1131,6 +1131,7 @@ static void __init iort_init_platform_devices(void)acpi_free_fwnode_static (fwnode);return ; } +pci_request_acs (); } iort_node = ACPI_ADD_PTR(struct acpi_iort_node, iort_node,
Yep, will send something similar shortly.
Thanks,
Lorenzo