Re: [PATCH v6 0/9] dmaengine: add DMA channel bus and fsl-edma per-channel IOMMU support

From: Peng Fan

Date: Tue Nov 17 2026 - 10:05:12 EST


On Tue, Nov 17, 2026 at 09:00:05AM -0400, Jason Gunthorpe wrote:
>On Tue, Nov 17, 2026 at 04:30:15PM +0800, Peng Fan wrote:
>> On Mon, Nov 16, 2026 at 03:30:21PM -0400, Jason Gunthorpe wrote:
>> >On Thu, Nov 12, 2026 at 03:53:03PM +0800, Peng Fan (OSS) wrote:
>> >> I used iommu-map for eDMA, but iommu experts rejected it:
>> >> "Using iommu-map to describe synthetic dma_chan_dev devices that the
>> >> kernel creates is the same kind of DT abuse from over here:"
>> >> More info: https://lore.kernel.org/all/20260917144804.GI3196566@xxxxxxxx/
>> >>
>> >> So I followed here [2] as Krzysztof wrote for QCOM VPU:
>> >> "Thanks Jason for context and detailed arguments. Robin did not chime in
>> >> yet, but from what I understood the DT-child-node approach will be the
>> >> way we should go here.
>> >>
>> >> I accept above point of view and I am fine with this, thus Vishnu and
>> >> Vikash - please go ahead with DT-child-node solution we had some time ago."
>> >> [2] https://lore.kernel.org/linux-iommu/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@xxxxxxxxxx/
>> >>
>> >> This series adds per-channel DT child node support to fsl-edma and, as a
>> >> prerequisite, introduces a proper bus for DMA channel devices.
>> >
>> >To be fair this is discouraged too, now that I've seen 3-4 people
>> >trying to do exactly the same thing I'm not as positive about the
>> >DT-child-node hack.
>>
>> I may not describe it clear in cover-letter.
>>
>> I understand the concern. Let me explain why I believe it is justified here
>> rather than a hack.
>>
>> On i.MX eDMA each channel has its own interrupt, its own register region,
>> and on i.MX8QM even its own power domain. Each channel may also have its
>> own Stream ID, or share one when SIDs are scarce. These are genuine
>> per-channel hardware resources, not software fiction.
>>
>> In dmaengine each channel is already modeled as a channel device (see
>> dmaengine_chan_dev()), and this series puts those devices on a real bus
>> (dmaengine_chan_bus_type) as a prerequisite. The DT child node simply
>> describes that existing device, so its reg/interrupts/power-domains/iommus
>> are attached per channel instead of as index-matched flat lists on the
>> controller.
>
>If they are real devices then why can't they come out as platform
>devices?
>
>I think you are overstating how independent they are. Many single
>devices have per "channel" resources like MMIO and IRQs. That's
>totally normal. It doesn't make the sub resources independent devices.
>
>AFAICT what you have here is some HW designer used SID where they
>should have used SSID and you are trying to hack DT to make that
>usable because Linux does not support a SID as SSID model today.

Thanks Jason, that clarifies the core issue.

Anyway, I agree that per-channel MMIO/IRQ/power-domains do not by themselves
make the channels independent devices. The real problem is that the eDMA could
have separate SIDs for channels that are logically part of one controller, i.e.
it uses SID where an SSID/substream would be the natural model, and Linux
does not support that today.

So I'd like to step back from the DT child-node shape and propose a
generic direction:

- 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.
- Use the SMMUv3 shared-SID support (still under reviewing) for channels that
must share a SID.

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.

Would that direction be acceptable, or do you see SID-as-SSID support in
the IOMMU core as the required longer-term fix?

Vinod, Frank, from dmaengine perspective, do you have any comments?
Rob, you reviewed DT binding patch, do you have any comments?

>
>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.

Thanks,
Peng

>
>Jason