sched/wait, arch/mips: Fix and convert wait_on_atomic_t() usage to the new wait_var_e...
authorPeter Zijlstra <peterz@infradead.org>
Thu, 15 Mar 2018 10:45:44 +0000 (11:45 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 20 Mar 2018 07:23:23 +0000 (08:23 +0100)
The old wait_on_atomic_t() is going to get removed, use the more
flexible wait_var_event() API instead.

And while there, fix a bug and add the missing wakeup...

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/mips/kernel/process.c
arch/mips/kernel/traps.c

index 57028d4..b9e9bf6 100644 (file)
@@ -781,6 +781,8 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
        atomic_set(&task->mm->context.fp_mode_switching, 0);
        preempt_enable();
 
+       wake_up_var(&task->mm->context.fp_mode_switching);
+
        return 0;
 }
 
index 0ae4a73..967e9e4 100644 (file)
@@ -1248,8 +1248,8 @@ static int enable_restore_fp_context(int msa)
         * If an FP mode switch is currently underway, wait for it to
         * complete before proceeding.
         */
-       wait_on_atomic_t(&current->mm->context.fp_mode_switching,
-                        atomic_t_wait, TASK_KILLABLE);
+       wait_var_event(&current->mm->context.fp_mode_switching,
+                      !atomic_read(&current->mm->context.fp_mode_switching));
 
        if (!used_math()) {
                /* First time FP context user. */