diff options
author | Mike Leach <[email protected]> | 2020-07-16 11:57:39 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2020-07-21 15:48:39 +0200 |
commit | 8fa43700f69703f995ea715b76be6fabdd2f05de (patch) | |
tree | 45903efb73864f0419f14c6eb47dfc71b1d2a4dd | |
parent | cb8bba907a4ff4ba42f1d245cb506d55829674b8 (diff) |
coresight: etmv4: Counter values not saved on disable
The counter value registers change during operation, however this change
is not reflected in the values seen by the user in sysfs.
This fixes the issue by reading back the values on disable.
Signed-off-by: Mike Leach <[email protected]>
Fixes: 2e1cdfe184b52 ("coresight-etm4x: Adding CoreSight ETM4x driver")
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/hwtracing/coresight/coresight-etm4x.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 2290f41f0074..2d732af8b3e7 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -511,6 +511,12 @@ static void etm4_disable_hw(void *info) readl_relaxed(drvdata->base + TRCSSCSRn(i)); } + /* read back the current counter values */ + for (i = 0; i < drvdata->nr_cntr; i++) { + config->cntr_val[i] = + readl_relaxed(drvdata->base + TRCCNTVRn(i)); + } + coresight_disclaim_device_unlocked(drvdata->base); CS_LOCK(drvdata->base); |