Re: [PATCH] iommu: Fix bypass of IOMMU readiness check for multi-IOMMU devices

From: Robin Murphy

Date: Thu Apr 02 2026 - 10:23:39 EST


On 2026-04-02 12:59 pm, Jason Gunthorpe wrote:
On Thu, Apr 02, 2026 at 02:25:54PM +0300, Tudor Ambarus wrote:

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 didn't think that was sketchy, it is part of the boot ordering
system to ensure that the iommu driver(s) is probed before the client
devices.

Half operating a device is definately going to get things into trouble
with broken/incomplete domain attachments at least.

The Exynos driver itself is actually fine, and doing everything right. We'll never have a "half-configured" client device in IOMMU API terms currently - only once both instances are registered such that both of_xlate calls can succeed (one for each specifier in the client device's "iommus" property) will we proceed to calling probe_device, which will then work as normal.

The issue here is purely in the race-avoidance scheme within of_iommu_configure() itself, which hasn't accounted for the fact that when it's looping over multiple specifiers, they don't necessarily all target the same IOMMU node. And it's only during a window where the instance targeted by the first specifier happens to be registered already, and the second is currently in the middle of registering.

Thanks,
Robin.