From: Sander Vanheule Date: Sat, 18 Dec 2021 10:05:10 +0000 (+0100) Subject: MIPS: only register MT SMP ops if MT is supported X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=047ff68b43d4dc912dd89d8e156e74af9f69ca93;p=linux.git MIPS: only register MT SMP ops if MT is supported Verify that the current CPU actually supports multi-threading before registering MT SMP ops, instead of unconditionally registering them if the kernel is compiled with CONFIG_MIPS_MT_SMP. Suggested-by: Jiaxun Yang Signed-off-by: Sander Vanheule Signed-off-by: Thomas Bogendoerfer --- diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h index 65618ff1280c9..864aea8039842 100644 --- a/arch/mips/include/asm/smp-ops.h +++ b/arch/mips/include/asm/smp-ops.h @@ -101,6 +101,9 @@ static inline int register_vsmp_smp_ops(void) #ifdef CONFIG_MIPS_MT_SMP extern const struct plat_smp_ops vsmp_smp_ops; + if (!cpu_has_mipsmt) + return -ENODEV; + register_smp_ops(&vsmp_smp_ops); return 0;