mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] iommu: Fix virtio-iommu probing
@ 2025-08-14 14:17 Eric Auger
  2025-08-14 14:53 ` Robin Murphy
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Auger @ 2025-08-14 14:17 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, robin.murphy, rafael, bhelgaas, jgg,
	lpieralisi, linux-acpi, linux-kernel, lenb, jean-philippe,
	jsnitsel

Commit bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper
probe path") broke virtio-iommu probing and no iommu group are
produced anymore.

When probe_iommu_group() gets called viommu_probe_device() fails
because viommu_get_by_fwnode(fwspec->iommu_fwnode) returns NULL.
So it seems we need to restore the original iommu_probe_device
call site in acpi_iommu_configure_id() to get a chance to probe
the device again.

Maybe this defeats the whole purpose of the original commit but
at least it fixes the virtio-iommu probing.

Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path")
Cc: stable@vger.kernel.org # v6.15+
Signed-off-by: Eric Auger <eric.auger@redhat.com>

---

I also tested smmu probing and this seems to work fine.
---
 drivers/acpi/scan.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index fb1fe9f3b1a3..9f4efa8f75a6 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1632,6 +1632,13 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
 		err = viot_iommu_configure(dev);
 	mutex_unlock(&iommu_probe_device_lock);
 
+	/*
+	 * If we have reason to believe the IOMMU driver missed the initial
+	 * iommu_probe_device() call for dev, replay it to get things in order.
+	 */
+	if (!err && dev->bus)
+		err = iommu_probe_device(dev);
+
 	return err;
 }
 
-- 
2.49.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-14 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-14 14:17 [RFC] iommu: Fix virtio-iommu probing Eric Auger
2025-08-14 14:53 ` Robin Murphy
2025-08-14 15:19   ` Eric Auger
2025-08-14 15:28     ` Robin Murphy
2025-08-14 15:34       ` Eric Auger

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®