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

Commit a41e318f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: tmc: Read the TMC mode register only if clk is enabled"

parents e0ab73b5 47d9cae0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ static void stm_disable(struct coresight_device *csdev,
	if (local_read(&drvdata->mode) == CS_MODE_SYSFS) {
		spin_lock(&drvdata->spinlock);
		stm_disable_hw(drvdata);
		drvdata->enable = false;
		spin_unlock(&drvdata->spinlock);

		/* Wait until the engine has completely stopped */
+14 −10
Original line number Diff line number Diff line
@@ -527,12 +527,14 @@ int tmc_read_prepare_etb(struct tmc_drvdata *drvdata)
		goto out;
	}

	if (drvdata->enable) {
		/* There is no point in reading a TMC in HW FIFO mode */
		mode = readl_relaxed(drvdata->base + TMC_MODE);
		if (mode != TMC_MODE_CIRCULAR_BUFFER) {
			ret = -EINVAL;
			goto out;
		}
	}

	val = local_read(&drvdata->mode);
	/* Don't interfere if operated from Perf */
@@ -571,12 +573,14 @@ int tmc_read_unprepare_etb(struct tmc_drvdata *drvdata)

	spin_lock_irqsave(&drvdata->spinlock, flags);

	if (drvdata->enable) {
		/* There is no point in reading a TMC in HW FIFO mode */
		mode = readl_relaxed(drvdata->base + TMC_MODE);
		if (mode != TMC_MODE_CIRCULAR_BUFFER) {
			spin_unlock_irqrestore(&drvdata->spinlock, flags);
			return -EINVAL;
		}
	}

	/* Re-enable the TMC if need be */
	if (local_read(&drvdata->mode) == CS_MODE_SYSFS) {