schemas: iommu: Add "iommu-ranges" on a device node - #207
Open
bvisredd wants to merge 1 commit into
Open
Conversation
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
approved these changes
Sep 9, 2026
krzk
left a comment
There was a problem hiding this comment.
This matches mailing list discussions and our internal talks how this can be solved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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