Skip to contentSkip to conversation

ACPI/IORT: Fix build without CONFIG_IOMMU_API

PATCH In review Christoph Hellwig 3 participants 3 messages May 20, 2019 – May 22, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI/IORT: Fix build without CONFIG_IOMMU_API

IOMMU_FWSPEC_PCI_RC_ATS is only defined if CONFIG_IOMMU_API is enabled.

Fixes 5702ee24182f ("ACPI/IORT: Check ATS capability in root complex nodes")
---
 drivers/acpi/arm64/iort.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +2 -1
index 9058cb084b91..3e542b5d2a2d 100644
@@ -1074,9 +1074,10 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
 		info.node = node;
 		err = pci_for_each_dma_alias(to_pci_dev(dev),
 					     iort_pci_iommu_init, &info);
-
+#ifdef CONFIG_IOMMU_API
 		if (!err && iort_pci_rc_supports_ats(node))
 			dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
+#endif
 	} else {
 		int i = 0;
 
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 14 lines · Christoph Hellwig

IOMMU_FWSPEC_PCI_RC_ATS is only defined if CONFIG_IOMMU_API is enabled.

Fixes 5702ee24182f ("ACPI/IORT: Check ATS capability in root complex nodes")
---
 drivers/acpi/arm64/iort.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +0 -0
index 9058cb084b91..3e542b5d2a2d 100644

drivers/acpi/arm64/iort.c const struct iommu_ops *iort_iommu_configure(struct device *dev) · line 1082

Quoted 10 lines
drivers/acpi/arm64/iort.c +2 -1
@@ -1074,9 +1074,10 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
 		info.node = node;
 		err = pci_for_each_dma_alias(to_pci_dev(dev),
 					     iort_pci_iommu_init, &info);
-
+#ifdef CONFIG_IOMMU_API
 		if (!err && iort_pci_rc_supports_ats(node))
 			dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
+#endif
 	} else {
 		int i = 0;

This was reported, please refer to this patch from Lorenzo:

https://patchwork.kernel.org/patch/10946845/

Thanks
Hanjun

#2 lore raw
In reply to Christoph Hellwig

Hi Christoph,

Quoted 14 lines · Christoph Hellwig

IOMMU_FWSPEC_PCI_RC_ATS is only defined if CONFIG_IOMMU_API is enabled.

Fixes 5702ee24182f ("ACPI/IORT: Check ATS capability in root complex nodes")
---
 drivers/acpi/arm64/iort.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +0 -0
index 9058cb084b91..3e542b5d2a2d 100644

drivers/acpi/arm64/iort.c const struct iommu_ops *iort_iommu_configure(struct device *dev) · line 1080

Quoted 8 lines
drivers/acpi/arm64/iort.c +2 -1
@@ -1074,9 +1074,10 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
 		info.node = node;
 		err = pci_for_each_dma_alias(to_pci_dev(dev),
 					     iort_pci_iommu_init, &info);
-
+#ifdef CONFIG_IOMMU_API
 		if (!err && iort_pci_rc_supports_ats(node))
 			dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
+#endif

Cheers, although there's an alternative fix from Lorenzo that I'll send up for -rc2.

Sorry for the delay; been having email issues this week.

Will