Lines Matching refs:ww_ctx
313 bool ww_mutex_spin_on_owner(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, in ww_mutex_spin_on_owner() argument
331 if (ww_ctx->acquired > 0 && READ_ONCE(ww->ctx)) in ww_mutex_spin_on_owner()
362 struct ww_acquire_ctx *ww_ctx, struct mutex_waiter *waiter) in mutex_spin_on_owner() argument
394 if (ww_ctx && !ww_mutex_spin_on_owner(lock, ww_ctx, waiter)) { in mutex_spin_on_owner()
458 mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, in mutex_optimistic_spin() argument
493 if (!mutex_spin_on_owner(lock, owner, ww_ctx, waiter)) in mutex_optimistic_spin()
536 mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, in mutex_optimistic_spin() argument
593 struct ww_acquire_ctx *ww_ctx, const bool use_ww_ctx) in __mutex_lock_common() argument
600 ww_ctx = NULL; in __mutex_lock_common()
607 if (ww_ctx) { in __mutex_lock_common()
608 if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) in __mutex_lock_common()
616 if (ww_ctx->acquired == 0) in __mutex_lock_common()
617 ww_ctx->wounded = 0; in __mutex_lock_common()
620 nest_lock = &ww_ctx->dep_map; in __mutex_lock_common()
629 mutex_optimistic_spin(lock, ww_ctx, NULL)) { in __mutex_lock_common()
632 if (ww_ctx) in __mutex_lock_common()
633 ww_mutex_set_context_fastpath(ww, ww_ctx); in __mutex_lock_common()
645 if (ww_ctx) in __mutex_lock_common()
646 __ww_mutex_check_waiters(lock, ww_ctx); in __mutex_lock_common()
654 waiter.ww_ctx = ww_ctx; in __mutex_lock_common()
666 ret = __ww_mutex_add_waiter(&waiter, lock, ww_ctx); in __mutex_lock_common()
696 if (ww_ctx) { in __mutex_lock_common()
697 ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx); in __mutex_lock_common()
718 if (mutex_optimistic_spin(lock, ww_ctx, &waiter)) in __mutex_lock_common()
730 if (ww_ctx) { in __mutex_lock_common()
735 if (!ww_ctx->is_wait_die && in __mutex_lock_common()
737 __ww_mutex_check_waiters(lock, ww_ctx); in __mutex_lock_common()
749 if (ww_ctx) in __mutex_lock_common()
750 ww_mutex_lock_acquired(ww, ww_ctx); in __mutex_lock_common()
779 unsigned long ip, struct ww_acquire_ctx *ww_ctx) in __ww_mutex_lock() argument
781 return __mutex_lock_common(lock, state, subclass, NULL, ip, ww_ctx, true); in __ww_mutex_lock()
797 int ww_mutex_trylock(struct ww_mutex *ww, struct ww_acquire_ctx *ww_ctx) in ww_mutex_trylock() argument
799 if (!ww_ctx) in ww_mutex_trylock()
809 if (ww_ctx->acquired == 0) in ww_mutex_trylock()
810 ww_ctx->wounded = 0; in ww_mutex_trylock()
813 ww_mutex_set_context_fastpath(ww, ww_ctx); in ww_mutex_trylock()
814 mutex_acquire_nest(&ww->base.dep_map, 0, 1, &ww_ctx->dep_map, _RET_IP_); in ww_mutex_trylock()