Commit f0baa040 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched/wait, drivers/media: Convert wait_on_atomic_t() usage to the new wait_var_event() API

The old wait_on_atomic_t() is going to get removed, use the more
flexible wait_var_event() API instead.

Unlike wake_up_atomic_t(), wake_up_var() will issue the wakeup
even if the variable is not 0.

No change in functionality.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent d224985a
...@@ -106,8 +106,8 @@ int hfi_core_deinit(struct venus_core *core, bool blocking) ...@@ -106,8 +106,8 @@ int hfi_core_deinit(struct venus_core *core, bool blocking)
if (!empty) { if (!empty) {
mutex_unlock(&core->lock); mutex_unlock(&core->lock);
wait_on_atomic_t(&core->insts_count, atomic_t_wait, wait_var_event(&core->insts_count,
TASK_UNINTERRUPTIBLE); !atomic_read(&core->insts_count));
mutex_lock(&core->lock); mutex_lock(&core->lock);
} }
...@@ -229,8 +229,8 @@ void hfi_session_destroy(struct venus_inst *inst) ...@@ -229,8 +229,8 @@ void hfi_session_destroy(struct venus_inst *inst)
mutex_lock(&core->lock); mutex_lock(&core->lock);
list_del_init(&inst->list); list_del_init(&inst->list);
atomic_dec(&core->insts_count); if (atomic_dec_and_test(&core->insts_count))
wake_up_atomic_t(&core->insts_count); wake_up_var(&core->insts_count);
mutex_unlock(&core->lock); mutex_unlock(&core->lock);
} }
EXPORT_SYMBOL_GPL(hfi_session_destroy); EXPORT_SYMBOL_GPL(hfi_session_destroy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment