Commit da95cf66 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'coresight-fixes-v6.1-1' of...

Merge tag 'coresight-fixes-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next

Suzuki writes:
   "coresight: Fixes for v6.1

    Fixes for coresight drivers for v6.1
     - Fix possible deadlock CTI mutexes (LOCKDEP)
     - Fix hang in CTI with runtime power management"

* tag 'coresight-fixes-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux:
  coresight: cti: Fix hang in cti_disable_hw()
  coresight: Fix possible deadlock with lock dependency
parents 9abf2313 665c157e
...@@ -1687,14 +1687,15 @@ struct coresight_device *coresight_register(struct coresight_desc *desc) ...@@ -1687,14 +1687,15 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
ret = coresight_fixup_device_conns(csdev); ret = coresight_fixup_device_conns(csdev);
if (!ret) if (!ret)
ret = coresight_fixup_orphan_conns(csdev); ret = coresight_fixup_orphan_conns(csdev);
if (!ret && cti_assoc_ops && cti_assoc_ops->add)
cti_assoc_ops->add(csdev);
out_unlock: out_unlock:
mutex_unlock(&coresight_mutex); mutex_unlock(&coresight_mutex);
/* Success */ /* Success */
if (!ret) if (!ret) {
if (cti_assoc_ops && cti_assoc_ops->add)
cti_assoc_ops->add(csdev);
return csdev; return csdev;
}
/* Unregister the device if needed */ /* Unregister the device if needed */
if (registered) { if (registered) {
......
...@@ -94,7 +94,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata) ...@@ -94,7 +94,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata)
unsigned long flags; unsigned long flags;
int rc = 0; int rc = 0;
pm_runtime_get_sync(dev->parent);
spin_lock_irqsave(&drvdata->spinlock, flags); spin_lock_irqsave(&drvdata->spinlock, flags);
/* no need to do anything if enabled or unpowered*/ /* no need to do anything if enabled or unpowered*/
...@@ -119,7 +118,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata) ...@@ -119,7 +118,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata)
/* cannot enable due to error */ /* cannot enable due to error */
cti_err_not_enabled: cti_err_not_enabled:
spin_unlock_irqrestore(&drvdata->spinlock, flags); spin_unlock_irqrestore(&drvdata->spinlock, flags);
pm_runtime_put(dev->parent);
return rc; return rc;
} }
...@@ -175,7 +173,6 @@ static int cti_disable_hw(struct cti_drvdata *drvdata) ...@@ -175,7 +173,6 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
coresight_disclaim_device_unlocked(csdev); coresight_disclaim_device_unlocked(csdev);
CS_LOCK(drvdata->base); CS_LOCK(drvdata->base);
spin_unlock(&drvdata->spinlock); spin_unlock(&drvdata->spinlock);
pm_runtime_put(dev->parent);
return 0; return 0;
/* not disabled this call */ /* not disabled this call */
...@@ -541,7 +538,7 @@ cti_match_fixup_csdev(struct cti_device *ctidev, const char *node_name, ...@@ -541,7 +538,7 @@ cti_match_fixup_csdev(struct cti_device *ctidev, const char *node_name,
/* /*
* Search the cti list to add an associated CTI into the supplied CS device * Search the cti list to add an associated CTI into the supplied CS device
* This will set the association if CTI declared before the CS device. * This will set the association if CTI declared before the CS device.
* (called from coresight_register() with coresight_mutex locked). * (called from coresight_register() without coresight_mutex locked).
*/ */
static void cti_add_assoc_to_csdev(struct coresight_device *csdev) static void cti_add_assoc_to_csdev(struct coresight_device *csdev)
{ {
...@@ -569,7 +566,8 @@ static void cti_add_assoc_to_csdev(struct coresight_device *csdev) ...@@ -569,7 +566,8 @@ static void cti_add_assoc_to_csdev(struct coresight_device *csdev)
* if we found a matching csdev then update the ECT * if we found a matching csdev then update the ECT
* association pointer for the device with this CTI. * association pointer for the device with this CTI.
*/ */
csdev->ect_dev = ect_item->csdev; coresight_set_assoc_ectdev_mutex(csdev->ect_dev,
ect_item->csdev);
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment