Re: [PATCH v5 04/13] iommu: of_iommu: Add support for "iommu-ranges" on a device node

From: Bryan O'Donoghue

Date: Mon Oct 26 2026 - 08:33:16 EST


On 26/10/2026 12:08, Vikash Garodia wrote:
https://github.com/devicetree-org/dt-schema/pull/207

Perhaps splitting this into two patches as an iommu-series would be best.
Intention was to keep the patch to add iommu-ranges property as part of
iris driver patches to show the usage of this new property.

I am fine either ways, whatever it takes for the maintainers of this
file to review.

Regards,
Vikash

          end = maps + size / sizeof(__be32);
@@ -258,6 +367,9 @@ void of_iommu_get_resv_regions(struct device *dev,
struct list_head *list)
                  }
                  type = iommu_resv_region_get_type(dev, &phys, iova,
length);
+                if (type != IOMMU_RESV_DIRECT)
+                    continue;
+
If you look in iommu_resv_region_get_type() you can emit

        dev_warn(dev, "treating non-direct mapping [%pr] -> [%pap-%pap]
as reservation\n", phys,
                 &start, &end);
        return IOMMU_RESV_RESERVED;

on a mismatch - which is not what the code will do now. Mismatch will
warn and then not map.

So maybe dev_err() saying you won't map - in the new patch for reg.
Either way this isn't a change specific to iommu-ranges.

Sure the above needs to be addressed though because its not a straight change.

Before if there was a mismatch it would sill be mapped - now we print a warning and _don't_ map.

I'm not sure that's really what you meant to do here but if it is it should be stated in the git log and IMO it should be a follow on change _after_ the initial addition (or before it) stating why mismatched will no longer be mapped.

Because add iommu-ranges != don't map mismatched, basically.

---
bod