Lines Matching refs:ctx
61 struct ww_acquire_ctx ctx; in __test_mutex() local
66 ww_acquire_init(&ctx, &ww_class); in __test_mutex()
77 ww_mutex_lock(&mtx.mutex, (flags & TEST_MTX_CTX) ? &ctx : NULL); in __test_mutex()
95 ww_acquire_fini(&ctx); in __test_mutex()
126 struct ww_acquire_ctx ctx; in test_aa() local
131 ww_acquire_init(&ctx, &ww_class); in test_aa()
134 ret = ww_mutex_lock(&mutex, &ctx); in test_aa()
140 ret = !ww_mutex_trylock(&mutex, &ctx); in test_aa()
154 if (ww_mutex_trylock(&mutex, &ctx)) { in test_aa()
161 ret = ww_mutex_lock(&mutex, &ctx); in test_aa()
174 ww_acquire_fini(&ctx); in test_aa()
191 struct ww_acquire_ctx ctx; in test_abba_work() local
194 ww_acquire_init_noinject(&ctx, &ww_class); in test_abba_work()
196 ww_mutex_lock(&abba->b_mutex, &ctx); in test_abba_work()
198 WARN_ON(!ww_mutex_trylock(&abba->b_mutex, &ctx)); in test_abba_work()
200 WARN_ON(READ_ONCE(abba->b_mutex.ctx) != &ctx); in test_abba_work()
205 err = ww_mutex_lock(&abba->a_mutex, &ctx); in test_abba_work()
208 ww_mutex_lock_slow(&abba->a_mutex, &ctx); in test_abba_work()
209 err = ww_mutex_lock(&abba->b_mutex, &ctx); in test_abba_work()
215 ww_acquire_fini(&ctx); in test_abba_work()
223 struct ww_acquire_ctx ctx; in test_abba() local
236 ww_acquire_init_noinject(&ctx, &ww_class); in test_abba()
238 ww_mutex_lock(&abba.a_mutex, &ctx); in test_abba()
240 WARN_ON(!ww_mutex_trylock(&abba.a_mutex, &ctx)); in test_abba()
242 WARN_ON(READ_ONCE(abba.a_mutex.ctx) != &ctx); in test_abba()
247 err = ww_mutex_lock(&abba.b_mutex, &ctx); in test_abba()
250 ww_mutex_lock_slow(&abba.b_mutex, &ctx); in test_abba()
251 err = ww_mutex_lock(&abba.a_mutex, &ctx); in test_abba()
257 ww_acquire_fini(&ctx); in test_abba()
291 struct ww_acquire_ctx ctx; in test_cycle_work() local
294 ww_acquire_init_noinject(&ctx, &ww_class); in test_cycle_work()
295 ww_mutex_lock(&cycle->a_mutex, &ctx); in test_cycle_work()
300 err = ww_mutex_lock(cycle->b_mutex, &ctx); in test_cycle_work()
304 ww_mutex_lock_slow(cycle->b_mutex, &ctx); in test_cycle_work()
305 erra = ww_mutex_lock(&cycle->a_mutex, &ctx); in test_cycle_work()
312 ww_acquire_fini(&ctx); in test_cycle_work()
435 struct ww_acquire_ctx ctx; in stress_inorder_work() local
446 ww_acquire_init(&ctx, &ww_class); in stress_inorder_work()
453 err = ww_mutex_lock(&locks[order[n]], &ctx); in stress_inorder_work()
468 ww_mutex_lock_slow(&locks[order[contended]], &ctx); in stress_inorder_work()
473 ww_acquire_fini(&ctx); in stress_inorder_work()
493 struct ww_acquire_ctx ctx; in stress_reorder_work() local
514 ww_acquire_init(&ctx, &ww_class); in stress_reorder_work()
517 err = ww_mutex_lock(ll->lock, &ctx); in stress_reorder_work()
531 ww_mutex_lock_slow(ll->lock, &ctx); in stress_reorder_work()
539 ww_acquire_fini(&ctx); in stress_reorder_work()