mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Konrad Dybcio <konradybcio@gmail.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Krzysztof Kozlowski <krzk@kernel.org>
Cc: 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,
	Vikash Garodia <vikash.garodia@oss.qualcomm.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,
	Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Robin Clark <robclark@qti.qualcomm.com>,
	Akhil P Oommen <akhilpo@oss.qualcomm.com>,
	Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>,
	Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>
Subject: Re: [PATCH] dma-iommu: Introduce API to reserve IOVA regions for dynamically created devices
Date: Fri, 17 Jul 2026 13:21:14 +0100	[thread overview]
Message-ID: <f61a0a67-2cb5-4fac-818e-70eb9ed69f95@arm.com> (raw)
In-Reply-To: <dba037fa-0f21-4a50-8727-076a3b177c47@gmail.com>

On 17/07/2026 11:44 am, Konrad Dybcio wrote:
> On 6/18/26 5:17 PM, Jason Gunthorpe wrote:
>> On Thu, Jun 18, 2026 at 01:57:40PM +0200, Krzysztof Kozlowski wrote:
> 
> [...]
> 
>> So, if we are going to do a hack in DT to accomodate Linux, I argue to
>> choose explicit child devices so VPU does not need to create a special
>> bus, call of_dma_configue, or hack in new DMA API things that only it
>> will ever use.
> 
> Bit late to the party, but I'll chime in with some more "amazing news"..
> 
> All of the multimedia HW on QC platforms (camera, display, GPU, video
> and their specialized variations) has at least part of the same problems:
> 
> * Multiple SID groups that need to be accommodated for different purposes
>    (normal vs secure buffers provided by the same device, different
>    "logical functions" generally speaking) apply to all of them
> 
> * Different IOVA limitations per SID group seems to also concern at
>   least the camera uC ("ICP") (but not all of camera hw)
> 
> * Remoteprocs (and therefore also the audio stack) expose a number of
>    subfunctions, some of which we currently model as subnodes (although
>    many arguably only exist as such because someone decided it was
>    convenient to express them this way). This, for example led to the
>    representation of each SID group associated with the remoteproc
>    (fastrpc/"run compute on rproc") as a separate node:
> 
> -- qcom/hamoa.dtsi
> remoteproc_adsp: remoteproc@6800000 {
> 	[...]
> 
> 	// no iommus OR iommus used for another purpose (fw loading)
> 
> 	fastrpc {
> 		// no iommus
> 
> 		compute-cb@3 {
> 			compatible = "qcom,fastrpc-compute-cb";
> 			reg = <3>;
> 			iommus = <&apps_smmu 0x1003 0x80>,
> 				 <&apps_smmu 0x1063 0x0>;
> 			dma-coherent;
> 		};
> 
> 		compute-cb@4 {
> 			compatible = "qcom,fastrpc-compute-cb";
> 			reg = <4>;
> 			iommus = <&apps_smmu 0x1004 0x80>,
> 				 <&apps_smmu 0x1064 0x0>;
> 			dma-coherent;
> 		};
> 
> 		[...] (there's a lot of them)
> 	};
> };
> 
> There may be more hiding in plain sight, but those are the ones I'm
> aware of.
> 
> 
> I was kinda hoping there would be more buy-in to follow what PCIe
> does, but to my understanding you're opposed to it because "vpu_bus"
> is not dynamically discoverable. PCIe generally obviously is, but
> we already have prior art regarding hardwired/onboard devices - many
> qcom DTs carry per-board iommu-map overrides to please the allocator
> with known-in-advance BDF values (because the HW has only so many
> SIDs):

It's not really about dynamic discoverability, it's more the fact that 
PCI requester IDs are a real and well-defined thing.

> -- qcom/qcs6490-rb3gen2-industrial-mezzanine.dtso
> iommu-map = <0x0 &apps_smmu 0x1c00 0x1>,
>              <0x100 &apps_smmu 0x1c01 0x1>,
>              <0x208 &apps_smmu 0x1c04 0x1>,
>              <0x210 &apps_smmu 0x1c05 0x1>,
>              <0x218 &apps_smmu 0x1c06 0x1>,
>              <0x300 &apps_smmu 0x1c07 0x1>,
>              <0x400 &apps_smmu 0x1c08 0x1>,
>              <0x500 &apps_smmu 0x1c09 0x1>,
>              <0x501 &apps_smmu 0x1c10 0x1>;
> 
> Although it seems to me that it's more of a hack than anything else..

No, that is describing a genuine mapping of physical PCIe requester ID 
values to physical SMMU StreamID values which exists in the system, and 
which any OS needs to understand in order to be able to configure the 
SMMU correctly at all. Sure, that mapping probably is programmed in a 
lookup table in the root complex by the bootloader in a board-specific 
manner (like I know the NXP Layerscape platforms do, for instance) but 
it's still a real description of the system configuration, and it's 
perfectly fine if StreamIDs and/or LUT entries are limited to only 
configure BDFs known to be present at boot (if there's no SR-IOV or 
hotplug to worry about), since it's a reasonable expectation that an OS 
won't go arbitrarily renumbering buses just for fun.

It's another thing entirely to have a bunch of distinct logical devices 
whose only physical identifier is already an SMMU StreamID, then invent 
a fake mapping of made-up numbers to StreamIDs in order to pretend they 
can use common infrastructure, except still needing invasive hacks at 
almost every level of said common infrastructure in order to even try to 
make it actually work.

How anyone can read, let alone write "This creates a limitation when 
child requires a different iommu-address range than its parent, as 
device tree cannot express the reservation per child." and not 
immediately conclude that the Devicetree binding must be wrong because 
it is unable to adequately describe the properties and requirements of 
the hardware, frankly I struggle to imagine...

Thanks,
Robin.

> 
> 
> With that in mind, do you still prefer that this is handled through
> separate nodes, presumably for all of the aforementioned cases?
> 
> Konrad


  reply	other threads:[~2026-07-17 12:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19  5:49 Vishnu Reddy
2026-01-19  8:00 ` Christoph Hellwig
2026-01-19 14:13 ` Robin Murphy
2026-06-10 14:27   ` Vishnu Reddy
2026-06-12 17:26     ` Jason Gunthorpe
2026-06-15  6:56       ` Vikash Garodia
2026-06-15 12:52         ` Jason Gunthorpe
2026-06-15 17:51           ` Vishnu Reddy
2026-06-17 19:40             ` Jason Gunthorpe
2026-06-18 11:57               ` Krzysztof Kozlowski
2026-06-18 15:17                 ` Jason Gunthorpe
2026-06-24 10:16                   ` Krzysztof Kozlowski
2026-07-17 10:44                   ` Konrad Dybcio
2026-07-17 12:21                     ` Robin Murphy [this message]
2026-07-17 16:07                     ` 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=f61a0a67-2cb5-4fac-818e-70eb9ed69f95@arm.com \
    --to=robin.murphy@arm.com \
    --cc=akhilpo@oss.qualcomm.com \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=busanna.reddy@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=ekansh.gupta@oss.qualcomm.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=konradybcio@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=m.szyprowski@samsung.com \
    --cc=robclark@qti.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.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

all inboxes | Powered by JetHome®