From: Peng Fan <peng.fan@oss.nxp.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>, Frank Li <frank.li@nxp.com>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
Jean-Philippe Brucker <jpb@kernel.org>,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH RFC 0/4] iommu/arm-smmu-v3: Support shared Stream IDs
Date: Fri, 18 Sep 2026 19:48:34 +0800 [thread overview]
Message-ID: <aq0lEk56qRi93geW@shlinux89> (raw)
In-Reply-To: <20260917144804.GI3196566@ziepe.ca>
Hi Jason,
On Thu, Sep 17, 2026 at 11:48:04AM -0300, Jason Gunthorpe wrote:
>On Thu, Sep 17, 2026 at 09:33:55AM +0800, Peng Fan wrote:
>> Hi Jason,
>>
>> On Wed, Sep 16, 2026 at 01:10:18PM -0300, Jason Gunthorpe wrote:
>> >On Wed, Sep 16, 2026 at 11:12:33PM +0800, Peng Fan (OSS) wrote:
>> >> Some SoCs have a limited number of IOMMU Stream IDs (SIDs) and
>> >> hardware that inherently shares them. For example, the NXP i.MX95
>> >> eDMA controller has 64 channels where each TX/RX pair is assigned
>> >> a single SID by the hardware - the two channel devices are distinct
>> >> from Linux's perspective but present the same SID to the SMMU.
>> >
>> >Is that a reflection of poor DT modelling though?
>> >
>> >Why must a TX/RX *PAIR* have two platform_devices nodes?
>> >
>> >Fix it there and you don't need any of this? Or is there more?
>>
>> I think there may be a misunderstanding about the device topology here.
>>
>> There is only one platform device node for the eDMA controller
>> (dma-controller@42000000). There are no separate platform device nodes per
>> channel pair.
>>
>> What happens instead:
>> The fsl-edma driver probes the single platform device. During
>> dmaenginem_async_device_register(), the dmaengine core calls
>
>Yes, and if your DT is correct then that platform device should have a
>single iommus = [] listing all the SIDs for that logical device.
Agreed - the DMA controller should use iommus, not iommu-map. I'll
rework the DT side. The iommu-map approach has not landed upstream,
so nothing is set in stone yet.
>
>Using iommu-map to describe synthetic dma_chan_dev devices that the
>kernel creates is the same kind of DT abuse from over here:
>
Thanks for sharing the links.
>https://lore.kernel.org/linux-iommu/20260618151745.GD231643@ziepe.ca/
Per reading this thread, seems need to describe VPU sub-blocks
blocks using device tree node.
For NXP i.MX95, we just use one device tree node for the DMA controller.
https://elixir.bootlin.com/linux/v7.2.5/source/arch/arm64/boot/dts/freescale/imx95.dtsi#L634
>
>So the problem is self created, by using iommu-map instead of iommus
>and using DT to describe linux SW expectations you end up in this
>strange place of asking for aliases.
The iommu-map DT property is not landed in upstream, it is still
under reviewing.
https://lore.kernel.org/dmaengine/20260916-edma-iommu-v1-1-e1731968081e@nxp.com/
>
>> The iommu-map property sits on the eDMA controller's DT node. At channel
>> allocation time (xlate), the driver calls of_dma_configure_id(chan_dev,
>> edma_np, true, &chan_id) to look up the channel index in the eDMA node's
>> iommu-map and attach an IOMMU domain to that specific channel device. The
>> dmaengine framework's dmaengine_get_dma_device() API
>> (which checks chan->dev->chan_dma_dev) then returns the per-channel device
>> instead of the parent platform device, so DMA clients map buffers through
>> the correct IOMMU context.
>
>So go back to the basics, why did this platform use iommu-map instead
>of iommus? The only real difference is you get a DMA translation per
>queue. Is that required? Are you short IOVA? Some other reason?
No, per-queue translation is not required. A single iommus entry (or
a list of all SIDs the controller uses) on the platform device would
work. I'll take this direction.
>
>You can read what I wrote about this general problem before:
>
>https://lore.kernel.org/linux-iommu/20260818130724.GA5482@ziepe.ca/
>
>It would be really nice if you all could work together to figure out a
>better way to handle this than through DT abuses.
Understood. I'll follow up on the links you shared and work with the
dmaengine folks to sort out the DT modelling.
However, the DMA channel case was just one example - the shared-SID
need exists independently of it. Our SoC (i.MX95) has only 64 SIDs
total, serving MMC, SD, NET, PCI, DMA, NPU, DSP, DISPLAY and more.
Some of these are genuinely separate platform devices (distinct DT
nodes, distinct drivers) that share a SID by hardware design because
the SID space is exhausted.
That cross-IP case cannot be solved by DT restructuring - the devices
really are separate. Would you be open to reviewing the shared-SID
SMMU support (patches 1-4) on that basis, independent of the DMA
channel question?
Thanks,
Peng
>
>If you really need unique translations per sub-compoment of a logical
>device from some pool of SIDs that feels like a weird version of PASID
>to me, it may be an interesting to explore.
>
>Jason
>
>
next prev parent reply other threads:[~2026-09-18 11:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 15:12 Peng Fan (OSS)
2026-09-16 15:12 ` [PATCH RFC 1/4] iommu/arm-smmu-v3: Convert streams from RB tree to XArray Peng Fan (OSS)
2026-09-16 15:12 ` [PATCH RFC 2/4] iommu/arm-smmu-v3: Support shared SIDs in insert/remove_master Peng Fan (OSS)
2026-09-16 15:12 ` [PATCH RFC 3/4] iommu/arm-smmu-v3: Group aliasing devices into the same IOMMU group Peng Fan (OSS)
2026-09-16 15:12 ` [PATCH RFC 4/4] iommu/arm-smmu-v3: Wire up shared-SID STE ordering and feature gating Peng Fan (OSS)
2026-09-16 16:10 ` [PATCH RFC 0/4] iommu/arm-smmu-v3: Support shared Stream IDs Jason Gunthorpe
2026-09-17 1:33 ` Peng Fan
2026-09-17 14:48 ` Jason Gunthorpe
2026-09-18 11:48 ` Peng Fan [this message]
2026-09-18 12:11 ` Jason Gunthorpe
2026-09-18 13:41 ` Peng Fan
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=aq0lEk56qRi93geW@shlinux89 \
--to=peng.fan@oss.nxp.com \
--cc=frank.li@nxp.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=jpb@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=robin.murphy@arm.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
all inboxes | Powered by JetHome®