Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sander Vanheule and committed by
Thomas Bogendoerfer
047ff68b 95339b70

+3
+3
arch/mips/include/asm/smp-ops.h
··· 101 101 #ifdef CONFIG_MIPS_MT_SMP 102 102 extern const struct plat_smp_ops vsmp_smp_ops; 103 103 104 + if (!cpu_has_mipsmt) 105 + return -ENODEV; 106 + 104 107 register_smp_ops(&vsmp_smp_ops); 105 108 106 109 return 0;