Skip to content

Commit

Permalink
coresight: etmv4: Counter values not saved on disable
Browse files Browse the repository at this point in the history
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 <mike.leach@linaro.org>
Fixes: 2e1cdfe ("coresight-etm4x: Adding CoreSight ETM4x driver")
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200716175746.3338735-11-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mike Leach authored and Greg Kroah-Hartman committed Jul 21, 2020
1 parent cb8bba9 commit 8fa4370
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/hwtracing/coresight/coresight-etm4x.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 8fa4370

Please sign in to comment.