]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/virtio: Make instance lookup robust
authorRobin Murphy <robin.murphy@arm.com>
Thu, 14 Aug 2025 16:47:16 +0000 (17:47 +0100)
committerJoerg Roedel <joerg.roedel@amd.com>
Fri, 22 Aug 2025 06:43:23 +0000 (08:43 +0200)
commit72b6f7cd89cea8251979b65528d302f9c0ed37bf
tree54386f086e2a4d61ad495443b6ab1376f16282d5
parent685ca577b408ffd9c5a4057a2acc0cd3e6978b36
iommu/virtio: Make instance lookup robust

Much like arm-smmu in commit 7d835134d4e1 ("iommu/arm-smmu: Make
instance lookup robust"), virtio-iommu appears to have the same issue
where iommu_device_register() makes the IOMMU instance visible to other
API callers (including itself) straight away, but internally the
instance isn't ready to recognise itself for viommu_probe_device() to
work correctly until after viommu_probe() has returned. This matters a
lot more now that bus_iommu_probe() has the DT/VIOT knowledge to probe
client devices the way that was always intended. Tweak the lookup and
initialisation in much the same way as for arm-smmu, to ensure that what
we register is functional and ready to go.

Cc: stable@vger.kernel.org
Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/308911aaa1f5be32a3a709996c7bd6cf71d30f33.1755190036.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/virtio-iommu.c