Re: [PATCH v5 04/13] iommu: of_iommu: Add support for "iommu-ranges" on a device node
From: Dmitry Baryshkov
Date: Thu Oct 22 2026 - 06:15:44 EST
On Sat, Sep 26, 2026 at 12:04:03PM +0530, Vikash Garodia wrote:
> Reserving an IOVA address using "iommu-addresses" requires it to be
> placed in the reserved-memory node. But when "iommu-addresses" is the
> only property being described and there is no backing "reg" (i.e. no
> actual reserved system memory), it does not really belong under
> /reserved-memory. A device IOVA range is specific to its own address
> space, and does not describe the system physical memory to make it
> qualify under reserved-memory. Given this, place "iommu-addresses"
> inside reserved-memory only when it is paired with a "reg", otherwise,
> define it within the device own node. It was discussed here:
> https://lore.kernel.org/all/662f7093-fb0a-4564-9ca0-98e03e68ba9a@xxxxxxxxxx
>
> Existing "iommu-addresses" property expects a phandle, which does
> not make sense when the property is defined within the device node.
> Introduce a new property, "iommu-ranges", to specify the device
> specific IOVA ranges when there is no backing "reg".
>
> Suggested-by: Rob Herring <robh@xxxxxxxxxx>
> Co-developed-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> Signed-off-by: Vikash Garodia <vikash.garodia@xxxxxxxxxxxxxxxx>
> ---
> drivers/iommu/of_iommu.c | 128 ++++++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 121 insertions(+), 7 deletions(-)
>
> +
> + list_for_each_entry_safe(pos, next_range, &ranges, node) {
> + if (pos->start > next) {
> + region = iommu_alloc_resv_region(next, pos->start - next, prot,
As pointed out by Sashiko, this can overflow on 32-bit LPAE platforms.
Other than that:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
As a note, we'd need this patch for the upcoming Qualcomm DCP display
driver (posted a week ago).
--
With best wishes
Dmitry