aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2018-03-15 11:42:06 +0100
committerIngo Molnar <[email protected]>2018-03-20 08:23:19 +0100
commitf0baa040f7a597fb099bf652c754b1a8a9e183f7 (patch)
tree3902562a5bcd370ef841bd01323afc7b87748839
parentd224985a5e312ab05b624143a3fd9bb91b53e52a (diff)
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: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stanimir Varbanov <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--drivers/media/platform/qcom/venus/hfi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c
index 1baf78d3c02d..bca894a00c07 100644
--- a/drivers/media/platform/qcom/venus/hfi.c
+++ b/drivers/media/platform/qcom/venus/hfi.c
@@ -106,8 +106,8 @@ int hfi_core_deinit(struct venus_core *core, bool blocking)
if (!empty) {
mutex_unlock(&core->lock);
- wait_on_atomic_t(&core->insts_count, atomic_t_wait,
- TASK_UNINTERRUPTIBLE);
+ wait_var_event(&core->insts_count,
+ !atomic_read(&core->insts_count));
mutex_lock(&core->lock);
}
@@ -229,8 +229,8 @@ void hfi_session_destroy(struct venus_inst *inst)
mutex_lock(&core->lock);
list_del_init(&inst->list);
- atomic_dec(&core->insts_count);
- wake_up_atomic_t(&core->insts_count);
+ if (atomic_dec_and_test(&core->insts_count))
+ wake_up_var(&core->insts_count);
mutex_unlock(&core->lock);
}
EXPORT_SYMBOL_GPL(hfi_session_destroy);