mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 13:58:46 +00:00
coresight: etmx: Claim devices before use
Use the CLAIM tags to grab the device for self-hosted usage. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2478a6ae4a
commit
68a147752d
@ -357,7 +357,7 @@ static int etm_parse_event_config(struct etm_drvdata *drvdata,
|
|||||||
|
|
||||||
static int etm_enable_hw(struct etm_drvdata *drvdata)
|
static int etm_enable_hw(struct etm_drvdata *drvdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i, rc;
|
||||||
u32 etmcr;
|
u32 etmcr;
|
||||||
struct etm_config *config = &drvdata->config;
|
struct etm_config *config = &drvdata->config;
|
||||||
|
|
||||||
@ -369,6 +369,9 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
|
|||||||
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);
|
||||||
|
|
||||||
@ -417,10 +420,15 @@ static int etm_enable_hw(struct etm_drvdata *drvdata)
|
|||||||
etm_writel(drvdata, 0x0, ETMVMIDCVR);
|
etm_writel(drvdata, 0x0, ETMVMIDCVR);
|
||||||
|
|
||||||
etm_clr_prog(drvdata);
|
etm_clr_prog(drvdata);
|
||||||
|
|
||||||
|
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\n", drvdata->cpu);
|
dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n",
|
||||||
return 0;
|
drvdata->cpu, rc);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct etm_enable_arg {
|
struct etm_enable_arg {
|
||||||
@ -569,6 +577,8 @@ 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));
|
||||||
|
|
||||||
|
coresight_disclaim_device_unlocked(drvdata->base);
|
||||||
|
|
||||||
etm_set_pwrdwn(drvdata);
|
etm_set_pwrdwn(drvdata);
|
||||||
CS_LOCK(drvdata->base);
|
CS_LOCK(drvdata->base);
|
||||||
|
|
||||||
|
@ -85,13 +85,17 @@ struct etm4_enable_arg {
|
|||||||
|
|
||||||
static int etm4_enable_hw(struct etmv4_drvdata *drvdata)
|
static int etm4_enable_hw(struct etmv4_drvdata *drvdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i, rc;
|
||||||
struct etmv4_config *config = &drvdata->config;
|
struct etmv4_config *config = &drvdata->config;
|
||||||
|
|
||||||
CS_UNLOCK(drvdata->base);
|
CS_UNLOCK(drvdata->base);
|
||||||
|
|
||||||
etm4_os_unlock(drvdata);
|
etm4_os_unlock(drvdata);
|
||||||
|
|
||||||
|
rc = coresight_claim_device_unlocked(drvdata->base);
|
||||||
|
if (rc)
|
||||||
|
goto done;
|
||||||
|
|
||||||
/* Disable the trace unit before programming trace registers */
|
/* Disable the trace unit before programming trace registers */
|
||||||
writel_relaxed(0, drvdata->base + TRCPRGCTLR);
|
writel_relaxed(0, drvdata->base + TRCPRGCTLR);
|
||||||
|
|
||||||
@ -179,10 +183,12 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata)
|
|||||||
dev_err(drvdata->dev,
|
dev_err(drvdata->dev,
|
||||||
"timeout while waiting for Idle Trace Status\n");
|
"timeout while waiting for Idle Trace Status\n");
|
||||||
|
|
||||||
|
done:
|
||||||
CS_LOCK(drvdata->base);
|
CS_LOCK(drvdata->base);
|
||||||
|
|
||||||
dev_dbg(drvdata->dev, "cpu: %d enable smp call done\n", drvdata->cpu);
|
dev_dbg(drvdata->dev, "cpu: %d enable smp call done: %d\n",
|
||||||
return 0;
|
drvdata->cpu, rc);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void etm4_enable_hw_smp_call(void *info)
|
static void etm4_enable_hw_smp_call(void *info)
|
||||||
@ -342,6 +348,8 @@ static void etm4_disable_hw(void *info)
|
|||||||
isb();
|
isb();
|
||||||
writel_relaxed(control, drvdata->base + TRCPRGCTLR);
|
writel_relaxed(control, drvdata->base + TRCPRGCTLR);
|
||||||
|
|
||||||
|
coresight_disclaim_device_unlocked(drvdata->base);
|
||||||
|
|
||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user