summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorSander Vanheule <sander@svanheule.net>2021-12-18 11:05:10 +0100
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-12-21 13:51:39 +0100
commit047ff68b43d4dc912dd89d8e156e74af9f69ca93 (patch)
treea49d94d2b82ce3001b9debdd70a302df69722a41 /arch/mips
parent95339b70677dc6f9a2d669c4716058e71b8dc1c7 (diff)
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 <jiaxun.yang@flygoat.com> Signed-off-by: Sander Vanheule <sander@svanheule.net> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/smp-ops.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h
index 65618ff1280c..864aea803984 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;