LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init()
authorHuacai Chen <chenhuacai@loongson.cn>
Fri, 26 Jan 2024 08:22:07 +0000 (16:22 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 26 Jan 2024 08:22:07 +0000 (16:22 +0800)
commit5056c596c3d1848021a4eaa76ee42f4c05c50346
tree3ecd98925c625312d67cd30c12e12a4eeb4a68ba
parent6613476e225e090cc9aad49be7fa504e290dd33d
LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init()

Machines which have more than 8 nodes fail to boot SMP after commit
a2ccf46333d7b2cf96 ("LoongArch/smp: Call rcutree_report_cpu_starting()
earlier"). Because such machines use tlb-based per-cpu base address
rather than dmw-based per-cpu base address, resulting per-cpu variables
can only be accessed after tlb_init(). But rcutree_report_cpu_starting()
is now called before tlb_init() and accesses per-cpu variables indeed.

Since the original patch want to avoid the lockdep warning caused by
page allocation in tlb_init(), we can move rcutree_report_cpu_starting()
to tlb_init() where after tlb exception configuration but before page
allocation.

Fixes: a2ccf46333d7b2cf96 ("LoongArch/smp: Call rcutree_report_cpu_starting() earlier")
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/smp.c
arch/loongarch/mm/tlb.c