aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2010-05-02 17:43:52 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-05-21 16:31:17 -0400
commit0103d23f44b1e9f8d2e89cc197e21192f6914f24 (patch)
treea5be6db45c86235702e10edd64a62bdd7072e40d /arch/mips
parent4f1e099582c119cf73d6a873b53e8edaa773d065 (diff)
MIPS: nofpu and nodsp only affect CPU0
The "nofpu" and "nodsp" kernel command line options currently do not affect CPUs that are brought online later in the boot process or hotplugged at runtime. It is desirable to apply the nofpu/nodsp options to all CPUs in the system, so that surprising results are not seen when a process migrates from one CPU to another. [Ralf: Moved definitions of mips_fpu_disabled, fpu_disable, mips_dsp_disabled and dsp_disable from setup.c to cpu-probe.c to allow making mips_fpu_disabled and mips_dsp_disabled static.] Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: http://patchwork.linux-mips.org/patch/1169/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/cpu-probe.c30
-rw-r--r--arch/mips/kernel/setup.c21
2 files changed, 30 insertions, 21 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index be5bb16be4e0..3562b854f2cd 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -125,6 +125,30 @@ static int __init wait_disable(char *s)
125 125
126__setup("nowait", wait_disable); 126__setup("nowait", wait_disable);
127 127
128static int __cpuinitdata mips_fpu_disabled;
129
130static int __init fpu_disable(char *s)
131{
132 cpu_data[0].options &= ~MIPS_CPU_FPU;
133 mips_fpu_disabled = 1;
134
135 return 1;
136}
137
138__setup("nofpu", fpu_disable);
139
140int __cpuinitdata mips_dsp_disabled;
141
142static int __init dsp_disable(char *s)
143{
144 cpu_data[0].ases &= ~MIPS_ASE_DSP;
145 mips_dsp_disabled = 1;
146
147 return 1;
148}
149
150__setup("nodsp", dsp_disable);
151
128void __init check_wait(void) 152void __init check_wait(void)
129{ 153{
130 struct cpuinfo_mips *c = &current_cpu_data; 154 struct cpuinfo_mips *c = &current_cpu_data;
@@ -982,6 +1006,12 @@ __cpuinit void cpu_probe(void)
982 */ 1006 */
983 BUG_ON(current_cpu_type() != c->cputype); 1007 BUG_ON(current_cpu_type() != c->cputype);
984 1008
1009 if (mips_fpu_disabled)
1010 c->options &= ~MIPS_CPU_FPU;
1011
1012 if (mips_dsp_disabled)
1013 c->ases &= ~MIPS_ASE_DSP;
1014
985 if (c->options & MIPS_CPU_FPU) { 1015 if (c->options & MIPS_CPU_FPU) {
986 c->fpu_id = cpu_get_fpu_id(); 1016 c->fpu_id = cpu_get_fpu_id();
987 1017
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f9513f9e61d3..85aef3fc6716 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -569,27 +569,6 @@ void __init setup_arch(char **cmdline_p)
569 plat_smp_setup(); 569 plat_smp_setup();
570} 570}
571 571
572static int __init fpu_disable(char *s)
573{
574 int i;
575
576 for (i = 0; i < NR_CPUS; i++)
577 cpu_data[i].options &= ~MIPS_CPU_FPU;
578
579 return 1;
580}
581
582__setup("nofpu", fpu_disable);
583
584static int __init dsp_disable(char *s)
585{
586 cpu_data[0].ases &= ~MIPS_ASE_DSP;
587
588 return 1;
589}
590
591__setup("nodsp", dsp_disable);
592
593unsigned long kernelsp[NR_CPUS]; 572unsigned long kernelsp[NR_CPUS];
594unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; 573unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
595 574