|
@@ -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;
|
|
|
}
|