Commit 8fa43700 authored by Mike Leach's avatar Mike Leach Committed by Greg Kroah-Hartman

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: default avatarMike Leach <mike.leach@linaro.org>
Fixes: 2e1cdfe1 ("coresight-etm4x: Adding CoreSight ETM4x driver")
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200716175746.3338735-11-mathieu.poirier@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cb8bba90
...@@ -511,6 +511,12 @@ static void etm4_disable_hw(void *info) ...@@ -511,6 +511,12 @@ static void etm4_disable_hw(void *info)
readl_relaxed(drvdata->base + TRCSSCSRn(i)); 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); coresight_disclaim_device_unlocked(drvdata->base);
CS_LOCK(drvdata->base); CS_LOCK(drvdata->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment