Lines Matching refs:abba

188 	struct test_abba *abba = container_of(work, typeof(*abba), work);  in test_abba_work()  local
193 if (!abba->trylock) in test_abba_work()
194 ww_mutex_lock(&abba->b_mutex, &ctx); in test_abba_work()
196 WARN_ON(!ww_mutex_trylock(&abba->b_mutex, &ctx)); in test_abba_work()
198 WARN_ON(READ_ONCE(abba->b_mutex.ctx) != &ctx); in test_abba_work()
200 complete(&abba->b_ready); in test_abba_work()
201 wait_for_completion(&abba->a_ready); in test_abba_work()
203 err = ww_mutex_lock(&abba->a_mutex, &ctx); in test_abba_work()
204 if (abba->resolve && err == -EDEADLK) { in test_abba_work()
205 ww_mutex_unlock(&abba->b_mutex); in test_abba_work()
206 ww_mutex_lock_slow(&abba->a_mutex, &ctx); in test_abba_work()
207 err = ww_mutex_lock(&abba->b_mutex, &ctx); in test_abba_work()
211 ww_mutex_unlock(&abba->a_mutex); in test_abba_work()
212 ww_mutex_unlock(&abba->b_mutex); in test_abba_work()
215 abba->result = err; in test_abba_work()
220 struct test_abba abba; in test_abba() local
224 ww_mutex_init(&abba.a_mutex, &ww_class); in test_abba()
225 ww_mutex_init(&abba.b_mutex, &ww_class); in test_abba()
226 INIT_WORK_ONSTACK(&abba.work, test_abba_work); in test_abba()
227 init_completion(&abba.a_ready); in test_abba()
228 init_completion(&abba.b_ready); in test_abba()
229 abba.trylock = trylock; in test_abba()
230 abba.resolve = resolve; in test_abba()
232 schedule_work(&abba.work); in test_abba()
236 ww_mutex_lock(&abba.a_mutex, &ctx); in test_abba()
238 WARN_ON(!ww_mutex_trylock(&abba.a_mutex, &ctx)); in test_abba()
240 WARN_ON(READ_ONCE(abba.a_mutex.ctx) != &ctx); in test_abba()
242 complete(&abba.a_ready); in test_abba()
243 wait_for_completion(&abba.b_ready); in test_abba()
245 err = ww_mutex_lock(&abba.b_mutex, &ctx); in test_abba()
247 ww_mutex_unlock(&abba.a_mutex); in test_abba()
248 ww_mutex_lock_slow(&abba.b_mutex, &ctx); in test_abba()
249 err = ww_mutex_lock(&abba.a_mutex, &ctx); in test_abba()
253 ww_mutex_unlock(&abba.b_mutex); in test_abba()
254 ww_mutex_unlock(&abba.a_mutex); in test_abba()
257 flush_work(&abba.work); in test_abba()
258 destroy_work_on_stack(&abba.work); in test_abba()
262 if (err || abba.result) { in test_abba()
264 __func__, err, abba.result); in test_abba()
268 if (err != -EDEADLK && abba.result != -EDEADLK) { in test_abba()
270 __func__, err, abba.result); in test_abba()