devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Robin Murphy <robin.murphy@arm.com>,
	 joro@8bytes.org, will@kernel.org, saravanak@google.com,
	conor+dt@kernel.org,  mchehab@kernel.org, bod@kernel.org,
	krzk+dt@kernel.org,  abhinav.kumar@linux.dev,
	vikash.garodia@oss.qualcomm.com,
	 dikshita.agarwal@oss.qualcomm.com,
	 Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	bjorn.andersson@oss.qualcomm.com,  linux-media@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,  iommu@lists.linux.dev
Subject: Re: [RFC PATCH 0/3] Introduce iommu-map-masked for platform devices
Date: Fri, 10 Oct 2025 17:30:11 -0500	[thread overview]
Message-ID: <CAL_Jsq+LPpJxVRUP4b9Gt40t=Wr=2B+697Jv2sjtDqTpqwGezQ@mail.gmail.com> (raw)
In-Reply-To: <c863f6a7-b117-4444-ae6d-1d525b572be2@oss.qualcomm.com>

On Fri, Oct 10, 2025 at 2:53 PM Charan Teja Kalla
<charan.kalla@oss.qualcomm.com> wrote:
>
>
>
> On 10/9/2025 11:55 PM, Dmitry Baryshkov wrote:
> >>> I really don't like the idea of extending the #iommu-cells. The ARM SMMU
> >>> has only one cell, which is correct even for our platforms. The fact
> >>> that we need to identify different IOMMU SIDs (and handle them in a
> >>> differnt ways) is internal to the video device (and several other
> >>> devices). There is nothing to be handled on the ARM SMMU side.
> >> Huh? So if you prefer not to change anything, are you suggesting this series
> >> doesn't need to exist at all? Now I'm thoroughly confused...
> > Hmm. We need changes, but I don't feel like adding the FUNCTION_ID to
> > #iommu-cells is the best idea.
> >
> >> If you want to use SMR masks, then you absolutely need #iommu-cells = 2,
> >> because that is the SMMU binding for using SMR masks. It would definitely
> > I'm sorry. Yes, we have #iommu-cells = <2>.
> >
> >> not be OK to have some magic property trying to smuggle
> >> IOMMU-driver-specific data contrary to what the IOMMU node itself says. As
> >> for iommu-map, I don't see what would be objectionable about improving the
> >> parsing to respect a real #iommu-cells value rather than hard-coding an
> >> assumption. Yes, we'd probably need to forbid entries with length > 1
> >> targeting IOMMUs with #iommu-cells > 1, since the notion of a linear
> > This will break e.g. PCIe on Qualcomm platforms:
> >
> >                         iommu-map = <0x0   &apps_smmu 0x1400 0x1>,
> >                                     <0x100 &apps_smmu 0x1401 0x1>;
> >
> >
> > But this seems unlogical anyway wrt. apps_smmu having #iommu-cells =
> > <2>. It depends on ARM SMMU ignoring the second cell when it's not
> > present.
> >
> >> relationship between the input ID and the output specifier falls apart when
> >> the specifier is complex, but that seems simple enough to implement and
> >> document (even if it's too fiddly to describe in the schema itself), and
> >> still certainly no worse than having another property that *is* just
> >> iommu-map with implicit length = 1.
> >>
> >> And if you want individual StreamIDs for logical functions to be attachable
> >> to distinct contexts then those functions absolutely must be visible to the
> >> IOMMU layer and the SMMU driver as independent devices with their own unique
> >> properties, which means either they come that way from the DT as of_platform
> >> devices in the first place, or you implement a full bus_type abstraction
>
> I don't want to dilute what Dmitry is saying here, but the below is what
> i can make out of Robin comments, please CMIW:
>
> iommu {
>         #iommu-cells = <2>;
> }
>
> video {
>    iommu = <iommu sid1 mask1>, <iommu sid2 mask2>;
>    #iommu-map-cells = 2; /* does it look weird to define here, even if
> it is SMMU property? */

No, not weird. interrupt-map similarly requires #interrupt-cells. So
it would be just #iommu-cells here.

>    iommu-map = <0 smmu sid3 mask3>,
>                <0 smmu sid4 mask4>;

But you only have 1 cell, not 2 here. The #iommu-cells in this node
would define the number of cells before 'smmu'. The #iommu-cells in
the &smmu node is the number of cells after the &smmu phandle.

Rob

  reply	other threads:[~2025-10-10 22:30 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28 17:17 [RFC PATCH 0/3] Introduce iommu-map-masked for platform devices Charan Teja Kalla
2025-09-28 17:17 ` [RFC PATCH 1/3] dtbindings: add binding for iommu-map-masked property Charan Teja Kalla
2025-09-28 17:17 ` [RFC PATCH 2/3] of: create a wrapper for of_map_id() Charan Teja Kalla
2025-09-28 17:17 ` [RFC PATCH 3/3] of: implment the 'iommu-map-masked' to represent multi-functional devices Charan Teja Kalla
2025-09-28 20:23 ` [RFC PATCH 0/3] Introduce iommu-map-masked for platform devices Rob Herring
2025-10-09  0:26   ` Krzysztof Kozlowski
2025-10-09 12:16     ` Robin Murphy
2025-10-09 13:16       ` Dmitry Baryshkov
2025-10-09 13:14     ` Dmitry Baryshkov
2025-10-09  3:05   ` Vikash Garodia
2025-09-29 10:20 ` Robin Murphy
2025-10-08 19:10   ` Charan Teja Kalla
2025-10-09 10:46     ` Robin Murphy
2025-10-09 13:19       ` Dmitry Baryshkov
2025-10-09 17:03         ` Robin Murphy
2025-10-09 18:25           ` Dmitry Baryshkov
2025-10-10 19:53             ` Charan Teja Kalla
2025-10-10 22:30               ` Rob Herring [this message]
2025-10-11  0:54                 ` Dmitry Baryshkov
2025-10-12 20:44               ` Bryan O'Donoghue
2025-10-12 21:57                 ` Bryan O'Donoghue
2025-10-12 22:47                 ` Dmitry Baryshkov
2025-10-13 10:18                   ` Bryan O'Donoghue
2025-10-13 11:20             ` Robin Murphy
2025-10-13 12:31               ` Dmitry Baryshkov
2025-10-14 14:07                 ` Robin Murphy
2025-10-14 18:33                   ` Dmitry Baryshkov
2025-10-15  8:32                   ` Charan Teja Kalla
2025-10-19 12:13                     ` Dmitry Baryshkov
2025-10-14 15:07                 ` Bryan O'Donoghue
2025-10-14 18:35                   ` Dmitry Baryshkov
2025-10-14 20:49                     ` Bryan O'Donoghue
2025-10-14 22:18                       ` Dmitry Baryshkov
2025-10-15  8:53                         ` Bryan O'Donoghue
2025-10-15 21:55                           ` Rob Herring
2025-10-14 22:38                       ` Dmitry Baryshkov

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='CAL_Jsq+LPpJxVRUP4b9Gt40t=Wr=2B+697Jv2sjtDqTpqwGezQ@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=bod@kernel.org \
    --cc=charan.kalla@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=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=saravanak@google.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;
as well as URLs for NNTP newsgroup(s).