Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 718fc96a authored by Neil Leeder's avatar Neil Leeder
Browse files

msm: perf: initialise krait perf L2 counter enables



Clear the L2 counter enables at initialisation.
They are undefined out of reset.

Change-Id: I957106012625ae09efec47d4f657381963d87a5a
Signed-off-by: default avatarNeil Leeder <nleeder@codeaurora.org>
parent 1502243d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ static char *descriptions =
	" 2 Perf: keep events across hotplug\n"
	" 3 Perf: bring CPU online if needed when disabling irq\n"
	" 4 Perf: Support sw events across hotplug\n"
	" 5 msm: perf: initialise krait perf L2 counter enables\n"
;

static ssize_t desc_read(struct file *fp, char __user *buf,
+7 −0
Original line number Diff line number Diff line
@@ -600,6 +600,8 @@ static struct platform_driver krait_l2_pmu_driver = {

static int __init register_krait_l2_pmu_driver(void)
{
	int i;

	/* Reset all ctrs */
	set_l2_indirect_reg(L2PMCR, L2PMCR_RESET_ALL);

@@ -621,6 +623,11 @@ static int __init register_krait_l2_pmu_driver(void)
	/* Avoid spurious interrupt if any */
	get_reset_pmovsr();

	/* Clear counter enables */
	disable_counter(l2_cycle_ctr_idx);
	for (i = 0; i < total_l2_ctrs; i++)
		disable_counter(i);

	return platform_driver_register(&krait_l2_pmu_driver);
}
device_initcall(register_krait_l2_pmu_driver);