summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2024-04-25 17:17:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-30 10:48:48 +0300
commitb397caeaf3c39a91f25d58027d484f08388eb674 (patch)
treee3b0fe2e925a9b9b893566da8ee43ec5bcf91321
parent386248134388f4c3f26f821a516dff8aded5c499 (diff)
downloadlinux-b397caeaf3c39a91f25d58027d484f08388eb674.tar.xz
LoongArch: Lately init pmu after smp is online
[ Upstream commit f3334ebb8a2a1841c2824594dd992e66de19deb2 ] There is an smp function call named reset_counters() to init PMU registers of every CPU in PMU initialization state. It requires that all CPUs are online. However there is an early_initcall() wrapper for the PMU init funciton init_hw_perf_events(), so that pmu init funciton is called in do_pre_smp_initcalls() which before function smp_init(). Function reset_counters() cannot work on other CPUs since they haven't boot up still. Here replace the wrapper early_initcall() with pure_initcall(), so that the PMU init function is called after every cpu is online. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/loongarch/kernel/perf_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/perf_event.c b/arch/loongarch/kernel/perf_event.c
index 0491bf453cd4..cac7cba81b65 100644
--- a/arch/loongarch/kernel/perf_event.c
+++ b/arch/loongarch/kernel/perf_event.c
@@ -884,4 +884,4 @@ static int __init init_hw_perf_events(void)
return 0;
}
-early_initcall(init_hw_perf_events);
+pure_initcall(init_hw_perf_events);