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

Skip to content
Commit ea65d1ec authored by Stephen Boyd's avatar Stephen Boyd
Browse files

iommu: msm: Fix lockdep warnings by removing virtual iommu device



Each physical iommu device is created as a child of a virtual
iommu device so that contexts can be located by name by
msm_iommu_get_ctx(). With device tree, the virtual iommu device
is created at runtime and the physical iommu devices are moved
under the virtual device at runtime via device_move().

Unfortunately, the devices are reparented while the iommu drivers
probe and so lockdep gets very upset when the driver core tries
to unlock the parent device after probe.

static int __driver_attach(struct device *dev, void *data)
{
	...

	if (dev->parent)	/* Needed for USB */
		device_lock(dev->parent); <--- No parent before
	device_lock(dev);
	if (!dev->driver)
		driver_probe_device(drv, dev);
	device_unlock(dev);
	if (dev->parent)		<--- Parent changed!
		device_unlock(dev->parent);

Fix this by removing the virtual device and having a list of
physical iommu devices. When the devices probe add them to the
list and use the list to find contexts by name.

Change-Id: I19c4d174e2124ebaca416ec7268d83fa62cada95
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 9178a7b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment