]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu: Manage driver probe deferral better
authorRobin Murphy <robin.murphy@arm.com>
Thu, 5 Dec 2024 16:33:58 +0000 (16:33 +0000)
committerWill Deacon <will@kernel.org>
Mon, 9 Dec 2024 22:46:54 +0000 (22:46 +0000)
Since iommu_fwspec_init() absorbed the basic driver probe deferral
check to wait for an IOMMU to register, we may as well handle the probe
deferral timeout there as well. The current inconsistency of callers
results in client devices deferring forever on an arm64 ACPI system
where an SMMU has failed its own driver probe.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/41fa59f156ef8d196d08fa75c4901e6d4b12e6c4.1733406914.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/iommu.c
drivers/iommu/of_iommu.c

index 599030e1e890ba6f0fa273ddd24fd3c9b2d1de44..851fd5aeccf52b9b84170f4754430df48c8cee22 100644 (file)
@@ -2819,7 +2819,7 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode)
        struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
 
        if (!ops)
-               return -EPROBE_DEFER;
+               return driver_deferred_probe_check_state(dev);
 
        if (fwspec)
                return ops == iommu_fwspec_ops(fwspec) ? 0 : -EINVAL;
index e7a6a1611d193bce7ea71537a7e339904a9341b5..97987cd78da9346ce820e7c47f749a50edfbb7de 100644 (file)
@@ -29,8 +29,6 @@ static int of_iommu_xlate(struct device *dev,
                return -ENODEV;
 
        ret = iommu_fwspec_init(dev, of_fwnode_handle(iommu_spec->np));
-       if (ret == -EPROBE_DEFER)
-               return driver_deferred_probe_check_state(dev);
        if (ret)
                return ret;