From: Krzysztof Kozlowski <krzk@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>,
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
devicetree@vger.kernel.org
Cc: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Robin Murphy <robin.murphy@arm.com>,
joro@8bytes.org, will@kernel.org, m.szyprowski@samsung.com,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
dikshita.agarwal@oss.qualcomm.com
Subject: Re: [PATCH] dma-iommu: Introduce API to reserve IOVA regions for dynamically created devices
Date: Thu, 18 Jun 2026 13:57:40 +0200 [thread overview]
Message-ID: <e9e76c9f-b3b1-4ffd-9547-183556f6bb60@kernel.org> (raw)
In-Reply-To: <20260617194038.GC231643@ziepe.ca>
On 17/06/2026 21:40, Jason Gunthorpe wrote:
> On Mon, Jun 15, 2026 at 11:21:45PM +0530, Vishnu Reddy wrote:
>> Hi Jason,
>>
>> Here, the parent node does not have an iommus property — it only has iommu-map,
>> like example below:
>>
>> iommu-map = <0x0 &apps_smmu 0x1940 0x0 0x1>, /* function_id 0 → SID 0x1940 */
>> <0x1 &apps_smmu 0x1943 0x0 0x1>, /* function_id 1 → SID 0x1943 */
>> <0x2 &apps_smmu 0x1944 0x0 0x1>; /* function_id 2 → SID 0x1944 */
>>
>> When the parent device is probed, of_dma_configure() is called, which
>> internally invokes of_dma_configure_id() with NULL as the function ID. Since
>> there is no iommus entry, no stream ID gets mapped to the parent device.
>
> Sure, but it still did of_dma_configure on the parent..
>
>> The child devices are created at runtime and have no of_node of their own. The
>> only place the iommu-map property exists is on the parent's of_node. So when
>> configuring a child device, we pass the parent's of_node along with the child's
>> specific function_id — this is how of_dma_configure_id() finds and maps the
>> correct stream ID to the child device only.
>
> The whole thing seems like the wrong way to use DT to me. Having an
> iommu-map in the dt that no iommus property ever uses strikes me as
> abusive.
Same with interrupt-map.
There are PCIe controller nodes which have interrupt-map and no
interrupts property ever uses them.
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/freescale/imx8mm.dtsi?h=v7.1#n1340
There might be DT children but they still won't have interrupts at all.
>
> Then hard coding the ID table and manually creating the missing
> struct devices in C code is a throw back to board files :(
There are no distinctive, specific child devices here. Devices in terms
of hardware. There are no resources of children, they are not real
hardware devices.
You mentioned earlier that DT description is incomplete or not proper. I
disagree. Adding any child here just to configure IOMMU differently is
abuse of DT - creating fake device nodes to overcome somehow Linux
limitations.
>
> Of course it doesn't fully work, it was never intended to be used like
> this.
>
> Why the resistance to doing DT properly with actual iommus and dma
> ranges for each and every stream your device needs?
Because DT person - me - told that creating child device nodes just to
configure iommus is abuse of DT. There are no child devices in terms of
hardware or firmware. The iommu ranges here are no real hardware.
However, said all this, since I pushed folks to come with the iommu-map
approach, I will revoke my disagreement to child device nodes in DT, if
you really believe that is the approach. IOW, I will agree to device
nodes in DT representing fake hardware-children, just for the sake of
Linux driver model limitations.
Best regards,
Krzysztof
next prev parent reply other threads:[~2026-06-18 11:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260119054936.3350128-1-busanna.reddy@oss.qualcomm.com>
[not found] ` <cfd23f75-8952-4463-abd5-815b995031b0@arm.com>
[not found] ` <bb59f07e-ca7e-f012-6a4b-0a148350b69c@oss.qualcomm.com>
[not found] ` <20260612172649.GM1066031@ziepe.ca>
[not found] ` <da77c21d-25b3-46c3-a48f-71f0549e9f5f@oss.qualcomm.com>
[not found] ` <20260615125257.GS1066031@ziepe.ca>
[not found] ` <dcc0d02e-91fb-ddbe-399a-0191bab94c4f@oss.qualcomm.com>
2026-06-17 19:40 ` [PATCH] dma-iommu: Introduce API to reserve IOVA regions for dynamically created devices Jason Gunthorpe
2026-06-18 11:57 ` Krzysztof Kozlowski [this message]
2026-06-18 15:17 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e9e76c9f-b3b1-4ffd-9547-183556f6bb60@kernel.org \
--to=krzk@kernel.org \
--cc=busanna.reddy@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=vikash.garodia@oss.qualcomm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox