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

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
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1687,14 +1687,15 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
		ret = coresight_fixup_device_conns(csdev);
	if (!ret)
		ret = coresight_fixup_orphan_conns(csdev);
	if (!ret && cti_assoc_ops && cti_assoc_ops->add)
		cti_assoc_ops->add(csdev);

out_unlock:
	mutex_unlock(&coresight_mutex);
	/* Success */
	if (!ret)
	if (!ret) {
		if (cti_assoc_ops && cti_assoc_ops->add)
			cti_assoc_ops->add(csdev);
		return csdev;
	}

	/* Unregister the device if needed */
	if (registered) {
+3 −5
Original line number Diff line number Diff line
@@ -94,7 +94,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata)
	unsigned long flags;
	int rc = 0;

	pm_runtime_get_sync(dev->parent);
	spin_lock_irqsave(&drvdata->spinlock, flags);

	/* no need to do anything if enabled or unpowered*/
@@ -119,7 +118,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata)
	/* cannot enable due to error */
cti_err_not_enabled:
	spin_unlock_irqrestore(&drvdata->spinlock, flags);
	pm_runtime_put(dev->parent);
	return rc;
}

@@ -175,7 +173,6 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
	coresight_disclaim_device_unlocked(csdev);
	CS_LOCK(drvdata->base);
	spin_unlock(&drvdata->spinlock);
	pm_runtime_put(dev->parent);
	return 0;

	/* not disabled this call */
@@ -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
 * 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)
{
@@ -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
			 * 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;
		}
	}