Re: [PATCH] iommu: Fix bypass of IOMMU readiness check for multi-IOMMU devices
From: Jason Gunthorpe
Date: Mon Mar 23 2026 - 13:54:56 EST
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?
> 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.
Jason