aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/coresight
diff options
context:
space:
mode:
authorMathieu Poirier <mathieu.poirier@linaro.org>2018-11-30 11:43:05 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-06 15:41:55 +0100
commit6dd4402f24a39a9903faf00c03bdd0eedefc3bd7 (patch)
treeb150d699ed6f8d9f2f8fa95e46d564f146fe927b /drivers/hwtracing/coresight
parentcoresight: etf: Release CLAIM tag after disabling the HW (diff)
downloadlinux-dev-6dd4402f24a39a9903faf00c03bdd0eedefc3bd7.tar.xz
linux-dev-6dd4402f24a39a9903faf00c03bdd0eedefc3bd7.zip
coresight: etm3x: Deal with CLAIM tag before and after accessing HW
This patch moves access to the CLAIM tag so that no modification to the HW happens before and after the CLAIM operation has been carried. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight')
-rw-r--r--drivers/hwtracing/coresight/coresight-etm3x.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
index fd5c4cca7db5..6f30d52da9e4 100644
--- a/drivers/hwtracing/coresight/coresight-etm3x.c
+++ b/drivers/hwtracing/coresight/coresight-etm3x.c
@@ -363,15 +363,16 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
CS_UNLOCK(drvdata->base);
+ rc = coresight_claim_device_unlocked(drvdata->base);
+ if (rc)
+ goto done;
+
/* Turn engine on */
etm_clr_pwrdwn(drvdata);
/* Apply power to trace registers */
etm_set_pwrup(drvdata);
/* Make sure all registers are accessible */
etm_os_unlock(drvdata);
- rc = coresight_claim_device_unlocked(drvdata->base);
- if (rc)
- goto done;
etm_set_prog(drvdata);
@@ -422,8 +423,6 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
etm_clr_prog(drvdata);
done:
- if (rc)
- etm_set_pwrdwn(drvdata);
CS_LOCK(drvdata->base);
dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n",
@@ -577,9 +576,9 @@ static void etm_disable_hw(void *info)
for (i = 0; i < drvdata->nr_cntr; i++)
config->cntr_val[i] = etm_readl(drvdata, ETMCNTVRn(i));
+ etm_set_pwrdwn(drvdata);
coresight_disclaim_device_unlocked(drvdata->base);
- etm_set_pwrdwn(drvdata);
CS_LOCK(drvdata->base);
dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu);