diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index f57891616357a1e940104a0ef9f577c6480206e0..dcccc6dc68e64d20347eb8e345f9feac4bb78276 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -597,6 +597,9 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) if (!(value & PR_FP_MODE_FR) && cpu_has_fpu && cpu_has_mips_r6) return -EOPNOTSUPP; + /* Proceed with the mode switch */ + preempt_disable(); + /* Save FP & vector context, then disable FPU & MSA */ if (task->signal == current->signal) lose_fpu(1); @@ -655,6 +658,7 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) /* Allow threads to use FP again */ atomic_set(&task->mm->context.fp_mode_switching, 0); + preempt_enable(); return 0; }