Commit 6dd4402f authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Greg Kroah-Hartman

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: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 32c58c4d
...@@ -363,15 +363,16 @@ static int etm_enable_hw(struct etm_drvdata *drvdata) ...@@ -363,15 +363,16 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
CS_UNLOCK(drvdata->base); CS_UNLOCK(drvdata->base);
rc = coresight_claim_device_unlocked(drvdata->base);
if (rc)
goto done;
/* Turn engine on */ /* Turn engine on */
etm_clr_pwrdwn(drvdata); etm_clr_pwrdwn(drvdata);
/* Apply power to trace registers */ /* Apply power to trace registers */
etm_set_pwrup(drvdata); etm_set_pwrup(drvdata);
/* Make sure all registers are accessible */ /* Make sure all registers are accessible */
etm_os_unlock(drvdata); etm_os_unlock(drvdata);
rc = coresight_claim_device_unlocked(drvdata->base);
if (rc)
goto done;
etm_set_prog(drvdata); etm_set_prog(drvdata);
...@@ -422,8 +423,6 @@ static int etm_enable_hw(struct etm_drvdata *drvdata) ...@@ -422,8 +423,6 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
etm_clr_prog(drvdata); etm_clr_prog(drvdata);
done: done:
if (rc)
etm_set_pwrdwn(drvdata);
CS_LOCK(drvdata->base); CS_LOCK(drvdata->base);
dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n", dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n",
...@@ -577,9 +576,9 @@ static void etm_disable_hw(void *info) ...@@ -577,9 +576,9 @@ static void etm_disable_hw(void *info)
for (i = 0; i < drvdata->nr_cntr; i++) for (i = 0; i < drvdata->nr_cntr; i++)
config->cntr_val[i] = etm_readl(drvdata, ETMCNTVRn(i)); config->cntr_val[i] = etm_readl(drvdata, ETMCNTVRn(i));
etm_set_pwrdwn(drvdata);
coresight_disclaim_device_unlocked(drvdata->base); coresight_disclaim_device_unlocked(drvdata->base);
etm_set_pwrdwn(drvdata);
CS_LOCK(drvdata->base); CS_LOCK(drvdata->base);
dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu); dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu);
......
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