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

Commit a1aa682f authored by Tingwei Zhang's avatar Tingwei Zhang
Browse files

coresight: tmc: Correct the status for ETR disable



Mode in etr drvdata is not reset to CS_MODE_DISABLED in USB case.
In this case, following ETR enablement on mem mode won't work.  Set
the mode status correctly.  Coresight source should be disabled
in reset case and echo 0 > enable_source case.  Decrease the refcnt
to disable the source correctly.

Change-Id: I6f88efcd22ef56dc12f85a821a1dc004b4dda3d8
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent 315ed7f6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1017,6 +1017,7 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev)
			spin_unlock_irqrestore(&drvdata->spinlock, flags);
			tmc_etr_bam_disable(drvdata);
			usb_qdss_close(drvdata->usbch);
			drvdata->mode = CS_MODE_DISABLED;
			goto out;
		} else {
			tmc_etr_disable_hw(drvdata);
+2 −0
Original line number Diff line number Diff line
@@ -812,6 +812,7 @@ static ssize_t enable_source_store(struct device *dev,
		if (ret)
			return ret;
	} else {
		atomic_set(csdev->refcnt, 1);
		coresight_disable(csdev);
	}

@@ -1058,6 +1059,7 @@ static ssize_t reset_source_sink_store(struct bus_type *bus,
		csdev = coresight_get_source(cspath->path);
		if (!csdev)
			continue;
		atomic_set(csdev->refcnt, 1);
		__coresight_disable(csdev);
	}