]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: RIMT: Only defer the IOMMU configuration in init stage
authorYicong Yang <yang.yicong@picoheart.com>
Thu, 25 Jun 2026 09:47:02 +0000 (17:47 +0800)
committerPaul Walmsley <pjw@kernel.org>
Thu, 25 Jun 2026 18:18:05 +0000 (12:18 -0600)
The IOMMU configuration will be deferred if the IOMMU driver
isn't probed by the time. Make this deferral only in the
initialization stage with driver_deferred_probe_check_state().
Otherwise the devices depends on IOMMU will be deferred forever
in case the IOMMU device probe failed or it doesn't appear in
the ACPI namespace.

Fixes: 8f7729552582 ("ACPI: RISC-V: Add support for RIMT")
Signed-off-by: Yicong Yang <yang.yicong@picoheart.com>
Link: https://patch.msgid.link/20260625094702.11558-1-yang.yicong@picoheart.com
[pjw@kernel.org: added Fixes line]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
drivers/acpi/riscv/rimt.c

index 906282b0e63c0cf431d07ef1737dfd57abfb8ffd..e4538fa6c2c822e1f147b6c3c59d9c10049b43cb 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <linux/acpi.h>
 #include <linux/acpi_rimt.h>
+#include <linux/device/driver.h>
 #include <linux/iommu.h>
 #include <linux/list.h>
 #include <linux/pci.h>
@@ -257,11 +258,11 @@ static int rimt_iommu_xlate(struct device *dev, struct acpi_rimt_node *node, u32
        rimt_fwnode = rimt_get_fwnode(node);
 
        /*
-        * The IOMMU drivers may not be probed yet.
-        * Defer the IOMMU configuration
+        * The IOMMU drivers may not be probed yet. Defer the IOMMU
+        * configuration if it's still in initialization stage.
         */
        if (!rimt_fwnode)
-               return -EPROBE_DEFER;
+               return driver_deferred_probe_check_state(dev);
 
        /*
         * EPROBE_DEFER ensures IOMMU is probed before the devices that