Devicetree
 help / color / mirror / Atom feed
* Re: [PATCH] dma-iommu: Introduce API to reserve IOVA regions for dynamically created devices
       [not found]           ` <dcc0d02e-91fb-ddbe-399a-0191bab94c4f@oss.qualcomm.com>
@ 2026-06-17 19:40             ` Jason Gunthorpe
  0 siblings, 0 replies; only message in thread
From: Jason Gunthorpe @ 2026-06-17 19:40 UTC (permalink / raw)
  To: Vishnu Reddy, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	devicetree
  Cc: Vikash Garodia, Robin Murphy, joro, will, m.szyprowski, iommu,
	linux-kernel, dikshita.agarwal

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.

Then hard coding the ID table and manually creating the missing
struct devices in C code is a throw back to board files :(

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?

Jason

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-17 19:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox