Re: [PATCH v6 0/9] dmaengine: add DMA channel bus and fsl-edma per-channel IOMMU support
From: Jason Gunthorpe
Date: Tue Nov 17 2026 - 13:17:09 EST
On Tue, Nov 17, 2026 at 11:04:29PM +0800, Peng Fan wrote:
> - Keep the DMA controller as one device and describe its channel Stream
> IDs in the controller node (ordered list, no per-channel child nodes and
> no requester-ID map).
> - Add a generic dmaengine/IOMMU mechanism that assigns one of those
> Stream IDs to each dma_chan_dev, so the channel gets its own IOMMU
> context/domain without inventing a DT device.
IMHO what you really need here is some way to get the DMA API for a
"PASID" combined with some way to convert SIDs in an iommus property
into a "PASID".
How exactly that looks, I'm, not sure, but you probably do need a
struct device to do DMA with as that is integral to how the DMA API
works.
If that is a real struct device or some proxy, I don't know. Long ago
there was some work on this topic and struct device per PASID seemed
to be the direction people were interested in.
> - Use the SMMUv3 shared-SID support (still under reviewing) for channels that
> must share a SID.
If you get struct device handles for the SID then you don't need this
at all since you'd have exactly N handles with no overlap.
You don't need to force the struct devices you want to use in the DMA
channel's model to be exactly used as the DMA device..
> This keeps DT describing real hardware (the controller's SIDs) and moves
> the Linux-specific unbundling into the core instead of a per-driver
> binding. Each channel occupies 64KB MMIO region and works independently.
> With separate DT node, it will be easy for us to do channel device passthrough
> when using Xen hypervisor. Now moving away from this, the remaining question is
> how to expose a channel for Xen/per-channel passthrough without a per-channel
> DT node, seems I need to add some code in Xen hypervisor to support channel
> passthrough.
Normally you'd make a VFIO driver for this, especially if you have a
"PASID". You really care about Xen? It is so weird in this area?
> >Again, since this is the 3rd - 4th case like this, it seems like a
> >popular hardware choice and we should try to do better to make Linux
> >support if we can.
>
> Yeah, I saw QCOM VPU case and thought child node usage was agreed from
> Krzysztof's reply. So I use same idea here.
It was but at that point it was the only one. Now there are two QCOM
ones, this and maybe another I forget.
Also, IIRC, it wasn't quite like this, the DT was supposed to create
real platform devices. This kernel creates struct devices and attaches
them to DT was the first idea that was pushed back on when it became
too complicated.
Jason