aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2014-07-11 11:44:34 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-08-01 18:06:44 -0400
commit3587ea888b8ed0a3d7e792738b4db687d9e7f73b (patch)
tree7f7fe5b13ab70d1f91c228391bc866f9de0cf8b5
parent70dff4d90aab40326d1d06a331e2b07eae99d067 (diff)
MIPS: ensure MSA gets disabled during boot
The kernel relies upon MSA being disabled when a task begins running, so that it can initialise or restore context in response to the resulting MSA disabled exception. Previously the state of MSA following boot was left as it was before the kernel ran, where MSA could potentially have been enabled. Explicitly disable it during boot to prevent any problems. As a nice side effect the code reads a little better too. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7306/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/kernel/cpu-probe.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index cd252fd684b7..66b8fe97f739 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -144,14 +144,13 @@ static inline int __cpu_has_fpu(void)
144 144
145static inline unsigned long cpu_get_msa_id(void) 145static inline unsigned long cpu_get_msa_id(void)
146{ 146{
147 unsigned long status, conf5, msa_id; 147 unsigned long status, msa_id;
148 148
149 status = read_c0_status(); 149 status = read_c0_status();
150 __enable_fpu(FPU_64BIT); 150 __enable_fpu(FPU_64BIT);
151 conf5 = read_c0_config5();
152 enable_msa(); 151 enable_msa();
153 msa_id = read_msa_ir(); 152 msa_id = read_msa_ir();
154 write_c0_config5(conf5); 153 disable_msa();
155 write_c0_status(status); 154 write_c0_status(status);
156 return msa_id; 155 return msa_id;
157} 156}