Skip to content

Commit 17b04a9

Browse files
coresight: etm4x: unlocking tracers in default arch init
As with the ETMv3.x driver, calling 'smp_call_function_single()' twice in a row is highly ineffective. As such moving function 'etm4_os_unlock()' before the default initialisation takes place, which results in the same outcome. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 66bbbb77540e846b9aac4c9467aca936128951bf)
1 parent 687e025 commit 17b04a9

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

drivers/hwtracing/coresight/coresight-etm4x.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ module_param_named(boot_enable, boot_enable, int, S_IRUGO);
4444
static int etm4_count;
4545
static struct etmv4_drvdata *etmdrvdata[NR_CPUS];
4646

47-
static void etm4_os_unlock(void *info)
47+
static void etm4_os_unlock(struct etmv4_drvdata *drvdata)
4848
{
49-
struct etmv4_drvdata *drvdata = (struct etmv4_drvdata *)info;
50-
5149
/* Writing any value to ETMOSLAR unlocks the trace registers */
5250
writel_relaxed(0x0, drvdata->base + TRCOSLAR);
51+
drvdata->os_unlock = true;
5352
isb();
5453
}
5554

@@ -286,6 +285,9 @@ static void etm4_init_arch_data(void *info)
286285
u32 etmidr5;
287286
struct etmv4_drvdata *drvdata = info;
288287

288+
/* Make sure all registers are accessible */
289+
etm4_os_unlock(drvdata);
290+
289291
CS_UNLOCK(drvdata->base);
290292

291293
/* find all capabilities of the tracing unit */
@@ -603,9 +605,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
603605
get_online_cpus();
604606
etmdrvdata[drvdata->cpu] = drvdata;
605607

606-
if (!smp_call_function_single(drvdata->cpu, etm4_os_unlock, drvdata, 1))
607-
drvdata->os_unlock = true;
608-
609608
if (smp_call_function_single(drvdata->cpu,
610609
etm4_init_arch_data, drvdata, 1))
611610
dev_err(dev, "ETM arch init failed\n");

0 commit comments

Comments
 (0)