diff --git a/drivers/base/dd.c b/drivers/base/dd.c index bea8da5f8a3a..efa1634214e6 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -609,6 +609,9 @@ static int really_probe(struct device *dev, const struct device_driver *drv) bool test_remove = IS_ENABLED(CONFIG_DEBUG_TEST_DRIVER_REMOVE) && !drv->suppress_bind_attrs; int ret, link_ret; + bool is_decon = (dev_name(dev) && strstr(dev_name(dev), "drmdecon")); + + dev_err(dev, "tudor: %s enter for driver %s\n", __func__, drv->name); if (defer_all_probes) { /* @@ -616,11 +619,14 @@ static int really_probe(struct device *dev, const struct device_driver *drv) * device_block_probing() which, in turn, will call * wait_for_device_probe() right after that to avoid any races. */ - dev_dbg(dev, "Driver %s force probe deferral\n", drv->name); + dev_err(dev, "Driver %s force probe deferral\n", drv->name); return -EPROBE_DEFER; } link_ret = device_links_check_suppliers(dev); + if (is_decon) + dev_err(dev, "tudor: %s device_links_check_suppliers() ret %d\n", + __func__, link_ret); if (link_ret == -EPROBE_DEFER) return link_ret; @@ -633,7 +639,13 @@ static int really_probe(struct device *dev, const struct device_driver *drv) } re_probe: + if (is_decon) + dev_err(dev, "tudor: %s before setting dev->driver %s\n", + __func__, drv->name); device_set_driver(dev, drv); + if (is_decon) + dev_err(dev, "tudor: %s after setting dev->driver %s\n", + __func__, drv->name); /* If using pinctrl, bind pins now before probing */ ret = pinctrl_bind_pins(dev); @@ -641,7 +653,13 @@ static int really_probe(struct device *dev, const struct device_driver *drv) goto pinctrl_bind_failed; if (dev->bus->dma_configure) { + if (is_decon) + dev_err(dev, "tudor: %s before dma_configure %s\n", + __func__, drv->name); ret = dev->bus->dma_configure(dev); + if (is_decon) + dev_err(dev, "tudor: %s after dma_configure %s ret = %d\n", + __func__, drv->name, ret); if (ret) goto pinctrl_bind_failed; } @@ -723,6 +741,10 @@ static int really_probe(struct device *dev, const struct device_driver *drv) if (dev->bus && dev->bus->dma_cleanup) dev->bus->dma_cleanup(dev); pinctrl_bind_failed: + + if (is_decon) + dev_err(dev, "tudor: %s clear dev->driver %s\n", + __func__, drv->name); device_links_no_driver(dev); device_unbind_cleanup(dev); done: diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 4926a43118e6..35042965b0f7 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -450,6 +450,11 @@ static int iommu_init_device(struct device *dev) struct iommu_device *iommu_dev; struct iommu_group *group; int ret; + bool is_decon = (dev_name(dev) && strstr(dev_name(dev), "drmdecon")); + + if (is_decon) + dev_err(dev, "tudor: %s, dev->iommu = %p, dev->iommu_group = %p\n", + __func__, dev->iommu, dev->iommu_group); if (!dev_iommu_get(dev)) return -ENOMEM; @@ -464,10 +469,19 @@ static int iommu_init_device(struct device *dev) mutex_unlock(&iommu_probe_device_lock); dev->bus->dma_configure(dev); mutex_lock(&iommu_probe_device_lock); + if (is_decon) + dev_err(dev, "tudor: %s, after bus->dma_configure(): dev->iommu = %p, dev->iommu_group = %p\n", + __func__, dev->iommu, dev->iommu_group); /* If another instance finished the job for us, skip it */ if (!dev->iommu || dev->iommu_group) return -ENODEV; + } else { + if (is_decon) + dev_err(dev, "tudor: %s, bus->dma_configure not called dev->iommu = %p, dev->iommu_group = %p, dev->iommu->fwspec = %p dev->driver = %p\n", + __func__, dev->iommu, dev->iommu_group, dev->iommu->fwspec, dev->driver); } + + /* * At this point, relevant devices either now have a fwspec which will * match ops registered with a non-NULL fwnode, or we can reasonably @@ -608,7 +622,10 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list struct iommu_group *group; struct group_device *gdev; int ret; + bool is_decon = (dev_name(dev) && strstr(dev_name(dev), "drmdecon")); + if (is_decon) + dev_err(dev, "tudor: %s enter\n", __func__); /* * Serialise to avoid races between IOMMU drivers registering in * parallel and/or the "replay" calls from ACPI/OF code via client @@ -3241,6 +3258,7 @@ int iommu_device_use_default_domain(struct device *dev) /* Caller is the driver core during the pre-probe path */ struct iommu_group *group = dev->iommu_group; int ret = 0; + bool is_decon = (dev_name(dev) && strstr(dev_name(dev), "drmdecon")); if (!group) return 0; @@ -3248,6 +3266,9 @@ int iommu_device_use_default_domain(struct device *dev) mutex_lock(&group->mutex); /* We may race against bus_iommu_probe() finalising groups here */ if (!group->default_domain) { + if (is_decon) + dev_err(dev, "tudor: %s, we hit !group->default_domain\n", + __func__); ret = -EPROBE_DEFER; goto unlock_out; } diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 6b989a62def2..af89f1c874dc 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -118,6 +118,7 @@ int of_iommu_configure(struct device *dev, struct device_node *master_np, { bool dev_iommu_present; int err; + bool is_decon = (dev_name(dev) && strstr(dev_name(dev), "drmdecon")); if (!master_np) return -ENODEV; @@ -155,13 +156,25 @@ int of_iommu_configure(struct device *dev, struct device_node *master_np, dev_iommu_free(dev); mutex_unlock(&iommu_probe_device_lock); + if (is_decon) + dev_err(dev, "tudor: %s: of_iommu_configure_device err = %d, dev_iommu_present = %d\n", + __func__, err, dev_iommu_present); /* * If we're not on the iommu_probe_device() path (as indicated by the * initial dev->iommu) then try to simulate it. This should no longer * happen unless of_dma_configure() is being misused outside bus code. */ - if (!err && dev->bus && !dev_iommu_present) + if (!err && dev->bus && !dev_iommu_present) { + if (is_decon) { + dev_iommu_present = dev->iommu; + dev_err(dev, "tudor: %s call iommu_probe_device new dev_iommu_present = %d, dev->iommu = %p\n", + __func__, dev_iommu_present, dev->iommu); + } err = iommu_probe_device(dev); + if (is_decon) + dev_err(dev, "tudor: %s after iommu_probe_device err = %d\n", + __func__, err); + } if (err && err != -EPROBE_DEFER) dev_dbg(dev, "Adding to IOMMU failed: %d\n", err);