Lines Matching refs:ww_ctx
181 ww_mutex_lock_acquired(struct ww_mutex *ww, struct ww_acquire_ctx *ww_ctx) in ww_mutex_lock_acquired() argument
195 DEBUG_LOCKS_WARN_ON(ww_ctx->done_acquire); in ww_mutex_lock_acquired()
197 if (ww_ctx->contending_lock) { in ww_mutex_lock_acquired()
202 DEBUG_LOCKS_WARN_ON(ww_ctx->contending_lock != ww); in ww_mutex_lock_acquired()
208 DEBUG_LOCKS_WARN_ON(ww_ctx->acquired > 0); in ww_mutex_lock_acquired()
209 ww_ctx->contending_lock = NULL; in ww_mutex_lock_acquired()
215 DEBUG_LOCKS_WARN_ON(ww_ctx->ww_class != ww->ww_class); in ww_mutex_lock_acquired()
217 ww_ctx->acquired++; in ww_mutex_lock_acquired()
218 ww->ctx = ww_ctx; in ww_mutex_lock_acquired()
278 struct ww_acquire_ctx *ww_ctx) in __ww_mutex_die() argument
280 if (!ww_ctx->is_wait_die) in __ww_mutex_die()
283 if (waiter->ww_ctx->acquired > 0 && __ww_ctx_less(waiter->ww_ctx, ww_ctx)) { in __ww_mutex_die()
301 struct ww_acquire_ctx *ww_ctx, in __ww_mutex_wound() argument
324 if (ww_ctx->acquired > 0 && __ww_ctx_less(hold_ctx, ww_ctx)) { in __ww_mutex_wound()
355 __ww_mutex_check_waiters(struct MUTEX *lock, struct ww_acquire_ctx *ww_ctx) in __ww_mutex_check_waiters() argument
364 if (!cur->ww_ctx) in __ww_mutex_check_waiters()
367 if (__ww_mutex_die(lock, cur, ww_ctx) || in __ww_mutex_check_waiters()
368 __ww_mutex_wound(lock, cur->ww_ctx, ww_ctx)) in __ww_mutex_check_waiters()
413 __ww_mutex_kill(struct MUTEX *lock, struct ww_acquire_ctx *ww_ctx) in __ww_mutex_kill() argument
415 if (ww_ctx->acquired > 0) { in __ww_mutex_kill()
420 DEBUG_LOCKS_WARN_ON(ww_ctx->contending_lock); in __ww_mutex_kill()
421 ww_ctx->contending_lock = ww; in __ww_mutex_kill()
468 if (!cur->ww_ctx) in __ww_mutex_check_kill()
491 struct ww_acquire_ctx *ww_ctx) in __ww_mutex_add_waiter() argument
496 if (!ww_ctx) { in __ww_mutex_add_waiter()
501 is_wait_die = ww_ctx->is_wait_die; in __ww_mutex_add_waiter()
513 if (!cur->ww_ctx) in __ww_mutex_add_waiter()
516 if (__ww_ctx_less(ww_ctx, cur->ww_ctx)) { in __ww_mutex_add_waiter()
523 int ret = __ww_mutex_kill(lock, ww_ctx); in __ww_mutex_add_waiter()
535 __ww_mutex_die(lock, cur, ww_ctx); in __ww_mutex_add_waiter()
553 __ww_mutex_wound(lock, ww_ctx, ww->ctx); in __ww_mutex_add_waiter()