From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
"Rob Herring (Arm)" <robh@kernel.org>,
Joerg Roedel <jroedel@suse.de>,
Bjorn Helgaas <bhelgaas@google.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
peter.griffin@linaro.org, andre.draszik@linaro.org,
willmcvicker@google.com, jyescas@google.com,
kernel-team@android.com, stable@vger.kernel.org
Subject: Re: [PATCH] iommu: Fix bypass of IOMMU readiness check for multi-IOMMU devices
Date: Thu, 2 Apr 2026 14:25:54 +0300 [thread overview]
Message-ID: <9892a17b-022e-41df-af1c-a2d684aa8db1@linaro.org> (raw)
In-Reply-To: <20260323173138.GB8437@ziepe.ca>
Hi, Jason,
On 3/23/26 7:31 PM, Jason Gunthorpe wrote:
> On Mon, Mar 23, 2026 at 06:46:39PM +0200, Tudor Ambarus wrote:
>
>> Downstream we have a display controller that's using:
>> iommus = <&sysmmu_19840000>, <&sysmmu_19c40000>;
>>
>> These are 2 distinct platform devices, they probe independently, they
>> each call iommu_device_register() independently.
>
> Sure, I guessed that is what you ment..
>
> Do you have an example of this in an upstream DTS file?
Yes, Exynos multimedia blocks use this upstream For example, in
arch/arm64/boot/dts/exynos/exynos5433.dtsi, the `decon` and `decon_tv`
nodes route through multiple sysmmus:
iommus = <&sysmmu_decon0x>, <&sysmmu_decon1x>;
Looking at the upstream exynos-iommu.c driver, it doesn't return
-EPROBE_DEFER if all the instances listed in iommus doesn't exist.
It seems it survives the race though, but only because of the
core_initcall ordering. In downstream the IOMMU is forced to be a
module which exposes this gap.
>
>> If I understood you correctly, the downstream driver shall model its
>> architecture and call iommu_device_register() only once after both
>> devices are configured.
>
> No.. I'm not being so perscriptive, I'm just saying that once
> iommu->ops->probe_device() returns then the device is fully setup and
> dev->iommu will operate all of the iommus described in iommus=<..>
>
> probe_device() cannot return some half setup device with only some of
> the iommu instances working.
>
> We don't have any core idea of a half setup result from
> probe_device() today.
>
>> If the core's intent is to strictly enforce a single IOMMU instance,
>> shouldn't iommu_fwspec_init() be checking
>> fwspec->iommu_fwnode == iommu_fwnode
>> instead of matching the ops? Because the core currently matches on
>> ops, it permits aggregating multiple physical instances with the
>> same ops into one fwspec.
>
> The driver is responsible to handle this, not the core. It has to hide
> this mess under its covers, not rely on multiple calls to of_xlate or
> however it has been hacked up.
>
> Probably it means something like of_xlate/probe_device has to
> EPROBE_DEFER if all the instances listed in iommus don't exist.
>
I can probably track whether all instances are ready, and defer if any
is not ready, but then I'll force the iommu clients to use the sketchy
replay path, which seems like a bad idea, according to Robin's feedback.
I haven't seen functional problems with the races, just the "something
fishy" dev_WARN. Maybe we shall downgrade that to dev_info.
Thanks!
ta
next prev parent reply other threads:[~2026-04-02 11:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 13:09 Tudor Ambarus
2026-03-23 13:54 ` Jason Gunthorpe
2026-03-23 16:46 ` Tudor Ambarus
2026-03-23 17:31 ` Jason Gunthorpe
2026-04-02 11:25 ` Tudor Ambarus [this message]
2026-04-02 11:59 ` Jason Gunthorpe
2026-04-02 14:20 ` Robin Murphy
2026-04-14 13:04 ` Tudor Ambarus
2026-03-24 11:40 ` Robin Murphy
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=9892a17b-022e-41df-af1c-a2d684aa8db1@linaro.org \
--to=tudor.ambarus@linaro.org \
--cc=andre.draszik@linaro.org \
--cc=bhelgaas@google.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=jyescas@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=stable@vger.kernel.org \
--cc=will@kernel.org \
--cc=willmcvicker@google.com \
/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®