diff mbox series

[v2,4/4] coresight: etm3x: Release CLAIM tag when operated from perf

Message ID 1541632132-1252-5-git-send-email-mathieu.poirier@linaro.org (mailing list archive)
State New, archived
Headers show
Series coresight: Fix miscellaneous problems with CLAIM tags | expand

Commit Message

Mathieu Poirier Nov. 7, 2018, 11:08 p.m. UTC
This patch deals with the release of the CLAIM tag when the ETM is
operated from perf.  Otherwise the tag is left asserted and subsequent
requests to use the device fail.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/hwtracing/coresight/coresight-etm3x.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Suzuki K Poulose Nov. 8, 2018, 5:28 p.m. UTC | #1
On 07/11/2018 23:08, Mathieu Poirier wrote:
> This patch deals with the release of the CLAIM tag when the ETM is
> operated from perf.  Otherwise the tag is left asserted and subsequent
> requests to use the device fail.
> 
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>   drivers/hwtracing/coresight/coresight-etm3x.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
> index 4f638d81a66a..d7f452e62193 100644
> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
> @@ -602,6 +602,7 @@ static void etm_disable_perf(struct coresight_device *csdev)
>   	 * power down the tracer.
>   	 */
>   	etm_set_pwrdwn(drvdata);
> +	coresight_disclaim_device_unlocked(drvdata->base);

Thanks for fixing this. IIUC, I think we have a problem in general with
mixing perf vs sysfs. Once a perf session uses the etm3x, we overwrite
the drvdata->config with the perf event specific controls and the sysfs
user may not be aware of that. We may have to do something similar we do
for ETR buf for sysfs/perf sessions. And then we may be able to merge
the enable/disable routines.

For this patch:

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
index 4f638d81a66a..d7f452e62193 100644
--- a/drivers/hwtracing/coresight/coresight-etm3x.c
+++ b/drivers/hwtracing/coresight/coresight-etm3x.c
@@ -602,6 +602,7 @@  static void etm_disable_perf(struct coresight_device *csdev)
 	 * power down the tracer.
 	 */
 	etm_set_pwrdwn(drvdata);
+	coresight_disclaim_device_unlocked(drvdata->base);
 
 	CS_LOCK(drvdata->base);
 }