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

MIPS: smp-cps: Add nothreads kernel parameter

When debugging a new system or core it can be useful to disable the use
of multithreading. Introduce a "nothreads" kernel command line parameter
that can be set in order to do so.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Niklas Cassel <niklas.cassel@axis.com>
Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12340/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Burton and committed by
Ralf Baechle
6422a913 5a3e7c02

+11
+11
arch/mips/kernel/smp-cps.c
··· 27 27 #include <asm/time.h> 28 28 #include <asm/uasm.h> 29 29 30 + static bool threads_disabled; 30 31 static DECLARE_BITMAP(core_power, NR_CPUS); 31 32 32 33 struct core_boot_config *mips_cps_core_bootcfg; 33 34 35 + static int __init setup_nothreads(char *s) 36 + { 37 + threads_disabled = true; 38 + return 0; 39 + } 40 + early_param("nothreads", setup_nothreads); 41 + 34 42 static unsigned core_vpe_count(unsigned core) 35 43 { 36 44 unsigned cfg; 45 + 46 + if (threads_disabled) 47 + return 1; 37 48 38 49 if ((!config_enabled(CONFIG_MIPS_MT_SMP) || !cpu_has_mipsmt) 39 50 && (!config_enabled(CONFIG_CPU_MIPSR6) || !cpu_has_vp))