LoongArch: Lately init pmu after smp is online
authorBibo Mao <maobibo@loongson.cn>
Thu, 25 Apr 2024 14:17:52 +0000 (22:17 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 25 Apr 2024 14:17:52 +0000 (22:17 +0800)
commitf3334ebb8a2a1841c2824594dd992e66de19deb2
treeb7c8ca8bc5eef16cd39be8528d18c513fceab980
parentd3119bc985fb645ad3b2a9cf9952c1d56d9daaa3
LoongArch: Lately init pmu after smp is online

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>
arch/loongarch/kernel/perf_event.c