]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
MIPS: ensure MSA gets disabled during boot
authorPaul Burton <paul.burton@imgtec.com>
Fri, 11 Jul 2014 15:44:34 +0000 (16:44 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 1 Aug 2014 22:06:44 +0000 (00:06 +0200)
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>
arch/mips/kernel/cpu-probe.c

index cd252fd684b7ea9d8bba1406497c121bdd3813a8..66b8fe97f739c4a91ef1f1c8c7ef524061405f96 100644 (file)
@@ -144,14 +144,13 @@ static inline int __cpu_has_fpu(void)
 
 static inline unsigned long cpu_get_msa_id(void)
 {
-       unsigned long status, conf5, msa_id;
+       unsigned long status, msa_id;
 
        status = read_c0_status();
        __enable_fpu(FPU_64BIT);
-       conf5 = read_c0_config5();
        enable_msa();
        msa_id = read_msa_ir();
-       write_c0_config5(conf5);
+       disable_msa();
        write_c0_status(status);
        return msa_id;
 }