@@ -1076,7 +1076,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
iort_pci_iommu_init, &info);
if (!err && iort_pci_rc_supports_ats(node))
- dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
+ iommu_fwspec_set_ats_flags(dev);
} else {
int i = 0;
@@ -479,6 +479,11 @@ static inline void dev_iommu_fwspec_set(struct device *dev,
dev->iommu_fwspec = fwspec;
}
+static inline void iommu_fwspec_set_ats_flags(struct device *dev)
+{
+ dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
+}
+
int iommu_probe_device(struct device *dev);
void iommu_release_device(struct device *dev);
@@ -770,6 +775,10 @@ static inline void iommu_fwspec_free(struct device *dev)
{
}
+static inline void iommu_fwspec_set_ats_flags(struct device *dev)
+{
+}
+
static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids,
int num_ids)
{
drivers/acpi/arm64/iort.c: In function iort_iommu_configure: drivers/acpi/arm64/iort.c:1079:21: error: struct iommu_fwspec has no member named flags dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; ^~ drivers/acpi/arm64/iort.c:1079:32: error: IOMMU_FWSPEC_PCI_RC_ATS undeclared (first use in this function) dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; ^~~~~~~~~~~~~~~~~~~~~~~ drivers/acpi/arm64/iort.c:1079:32: note: each undeclared identifier is reported only once for each function it appears in Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Will Deacon <will.deacon@arm.com> Fixes: 5702ee24182f ("ACPI/IORT: Check ATS capability in root complex nodes") Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- drivers/acpi/arm64/iort.c | 2 +- include/linux/iommu.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)