Skip to content

schemas: iommu: Add "iommu-ranges" on a device node - #207

Open
bvisredd wants to merge 1 commit into
devicetree-org:mainfrom
bvisredd:iommu_ranges
Open

schemas: iommu: Add "iommu-ranges" on a device node#207
bvisredd wants to merge 1 commit into
devicetree-org:mainfrom
bvisredd:iommu_ranges

Conversation

@bvisredd

@bvisredd bvisredd commented Sep 7, 2026

Copy link
Copy Markdown

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 belong under /reserved-memory. A device's IOVA range is specific to how that device's own address space is mapped, not a description of memory shared across the system. So "iommu-addresses" should only be used with a "reg"; only then should it be placed inside the /reserved-memory. IOVA addresses specific to a particular device should instead go under that device's own node. This was discussed here:
https://lore.kernel.org/all/662f7093-fb0a-4564-9ca0-98e03e68ba9a@kernel.org

Using the same "iommu-addresses" property, typed as a phandle array, under the device's own node is not suitable, because "iommu-addresses" expects a phandle. If the property is placed inside the device node, a phandle is not required, since the property then belongs only to that device node. Introduced a new property, "iommu-ranges", for the IOVA ranges required for DMA memory mapping to that device node.

If a device is restricted to use only specific IOVA regions for DMA memory mapping, "iommu-ranges" should be present on that device's node, listing those usable ranges. If a device has no such restriction, "iommu-ranges" is not needed, and the device's full IOVA address space remains available for DMA memory mapping.

Suggested-by: Rob Herring robh@kernel.org
Signed-off-by: Vishnu Reddy busanna.reddy@oss.qualcomm.com

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 belong under /reserved-memory. A device's IOVA range is specific
to how that device's own address space is mapped, not a description
of memory shared across the system. So "iommu-addresses" should only
be used with a "reg"; only then should it be placed inside the
/reserved-memory. IOVA addresses specific to a particular device
should instead go under that device's own node. This was discussed here:
https://lore.kernel.org/all/662f7093-fb0a-4564-9ca0-98e03e68ba9a@kernel.org

Using the same "iommu-addresses" property, typed as a phandle array,
under the device's own node is not suitable, because "iommu-addresses"
expects a phandle. If the property is placed inside the device node,
a phandle is not required, since the property then belongs only to
that device node. Introduced a new property, "iommu-ranges", for the
IOVA ranges required for DMA memory mapping to that device node.

If a device is restricted to use only specific IOVA regions for DMA
memory mapping, "iommu-ranges" should be present on that device's node,
listing those usable ranges. If a device has no such restriction,
"iommu-ranges" is not needed, and the device's full IOVA address
space remains available for DMA memory mapping.

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>

@krzk krzk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches mailing list discussions and our internal talks how this can be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants