Skip to content

Commit e8e683a

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/of: Fix probe-deferral
Whilst iommu_probe_device() does check for non-NULL ops as the previous code did, it does not do so in the same order relative to the other checks, and as a result means that -EPROBE_DEFER returned by of_xlate() (plus any real error condition too) gets overwritten with -EINVAL and leads to various misbehaviour. Reinstate the original logic, but without implicitly relying on ops being set to infer !err as the initial condition (now that the validity of ops for its own sake is checked elsewhere). Fixes: 641fb0e ("iommu/of: Don't call iommu_ops->add_device directly") Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent bfeffd1 commit e8e683a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/of_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
224224
* If we have reason to believe the IOMMU driver missed the initial
225225
* probe for dev, replay it to get things in order.
226226
*/
227-
if (dev->bus && !device_iommu_mapped(dev))
227+
if (!err && dev->bus && !device_iommu_mapped(dev))
228228
err = iommu_probe_device(dev);
229229

230230
/* Ignore all other errors apart from EPROBE_DEFER */

0 commit comments

Comments
 (0)