MIPS: smp-cps: Add nothreads kernel parameter
authorPaul Burton <[email protected]>
Wed, 3 Feb 2016 03:15:34 +0000 (03:15 +0000)
committerRalf Baechle <[email protected]>
Fri, 13 May 2016 12:01:50 +0000 (14:01 +0200)
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 <[email protected]>
Cc: Matt Redfearn <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Niklas Cassel <[email protected]>
Cc: Ezequiel Garcia <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/12340/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/kernel/smp-cps.c

index 06512171fd194448986931ac7db03f15976ced88..1061bd2e7e9cac4b5875206a1ea7eb1df9421132 100644 (file)
 #include <asm/time.h>
 #include <asm/uasm.h>
 
+static bool threads_disabled;
 static DECLARE_BITMAP(core_power, NR_CPUS);
 
 struct core_boot_config *mips_cps_core_bootcfg;
 
+static int __init setup_nothreads(char *s)
+{
+       threads_disabled = true;
+       return 0;
+}
+early_param("nothreads", setup_nothreads);
+
 static unsigned core_vpe_count(unsigned core)
 {
        unsigned cfg;
 
+       if (threads_disabled)
+               return 1;
+
        if ((!config_enabled(CONFIG_MIPS_MT_SMP) || !cpu_has_mipsmt)
                && (!config_enabled(CONFIG_CPU_MIPSR6) || !cpu_has_vp))
                return 1;