]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:21:20 +0000 (16:21 -0800)
commit3cb11d189673ae012ecad07bbbcd70bb08ca884b
tree474928606a1ab19eb2fc248777c887946a3c54ee
parent19d73c253a444d2005a914d840822959eb5db8de
LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init()

[ Upstream commit 5056c596c3d1848021a4eaa76ee42f4c05c50346 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/kernel/smp.c
arch/loongarch/mm/tlb.c