]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu: Don't warn prematurely about dodgy probes
authorRobin Murphy <robin.murphy@arm.com>
Wed, 12 Mar 2025 15:01:31 +0000 (15:01 +0000)
committerJoerg Roedel <jroedel@suse.de>
Wed, 12 Mar 2025 15:58:27 +0000 (16:58 +0100)
The warning for suspect probe conditions inadvertently got moved too
early in a prior respin - it happened to work out OK for fwspecs, but in
general still needs to be after the ops->probe_device call so drivers
which filter devices for themselves have a chance to do that.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path")
Link: https://lore.kernel.org/r/72a4853e7ef36e7c1c4ca171ed4ed8e1a463a61a.1741791691.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c

index c283721579b33a7beb3f6477df15d6791e018ba8..9e1b444246f8b81b631d3bd5829ace55bcf0fdc4 100644 (file)
@@ -441,12 +441,6 @@ static int iommu_init_device(struct device *dev)
                ret = -ENODEV;
                goto err_free;
        }
-       /*
-        * And if we do now see any replay calls, they would indicate someone
-        * misusing the dma_configure path outside bus code.
-        */
-       if (dev->driver)
-               dev_WARN(dev, "late IOMMU probe at driver bind, something fishy here!\n");
 
        if (!try_module_get(ops->owner)) {
                ret = -EINVAL;
@@ -569,6 +563,12 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list
        ret = iommu_init_device(dev);
        if (ret)
                return ret;
+       /*
+        * And if we do now see any replay calls, they would indicate someone
+        * misusing the dma_configure path outside bus code.
+        */
+       if (dev->driver)
+               dev_WARN(dev, "late IOMMU probe at driver bind, something fishy here!\n");
 
        group = dev->iommu_group;
        gdev = iommu_group_alloc_device(group, dev);