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:
Stephen Boyd <sboyd@codeaurora.org>
Loading
Please register or sign in to comment