Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94c99712 authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

iommu/of: return -EPROBE_DEFER when smmu driver is not registered



Return -EPROBE_DEFER from of_iommu_xlate() for the smmu client devices
that are on the platform bus but trying to register their drivers before
SMMU driver registration happens. Without this deferral probe can result
into a situation of not adding the smmu clients to any of the iommu
groups thus can't use iommu_*() services.

Change-Id: I7b9da4ea1bc3bdcfb17e3c81b85938d50544fb9d
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 58b6ed92
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -119,6 +119,14 @@ static int of_iommu_xlate(struct device *dev,
	int err;

	ops = iommu_ops_from_fwnode(fwnode);
	/*
	 * Return -EPROBE_DEFER for the platform devices which are dependent
	 * on the SMMU driver registration. Deferring from here helps in adding
	 * the clients in proper iommu groups.
	 */
	if (!dev_is_pci(dev) && of_device_is_available(iommu_spec->np) && !ops)
		return -EPROBE_DEFER;

	if ((ops && !ops->of_xlate) ||
	    !of_device_is_available(iommu_spec->np) ||
	    (!ops && !of_iommu_driver_present(iommu_spec->np)))