Lines Matching refs:waiter

36 static bool add_waiter_to_queue(struct host1x_waitlist *waiter,  in add_waiter_to_queue()  argument
40 u32 thresh = waiter->thresh; in add_waiter_to_queue()
44 list_add(&waiter->list, &pos->list); in add_waiter_to_queue()
48 list_add(&waiter->list, queue); in add_waiter_to_queue()
60 struct host1x_waitlist *waiter, *next, *prev; in remove_completed_waiters() local
62 list_for_each_entry_safe(waiter, next, head, list) { in remove_completed_waiters()
63 if ((s32)(waiter->thresh - sync) > 0) in remove_completed_waiters()
66 dest = completed + waiter->action; in remove_completed_waiters()
69 if (waiter->action == HOST1X_INTR_ACTION_SUBMIT_COMPLETE && in remove_completed_waiters()
73 if (prev->data == waiter->data) { in remove_completed_waiters()
80 if (atomic_inc_return(&waiter->state) == WLS_HANDLED || !dest) { in remove_completed_waiters()
81 list_del(&waiter->list); in remove_completed_waiters()
82 kref_put(&waiter->refcount, waiter_release); in remove_completed_waiters()
84 list_move_tail(&waiter->list, dest); in remove_completed_waiters()
99 static void action_submit_complete(struct host1x_waitlist *waiter) in action_submit_complete() argument
101 struct host1x_channel *channel = waiter->data; in action_submit_complete()
107 waiter->count, waiter->thresh); in action_submit_complete()
110 static void action_wakeup(struct host1x_waitlist *waiter) in action_wakeup() argument
112 wait_queue_head_t *wq = waiter->data; in action_wakeup()
117 static void action_wakeup_interruptible(struct host1x_waitlist *waiter) in action_wakeup_interruptible() argument
119 wait_queue_head_t *wq = waiter->data; in action_wakeup_interruptible()
124 typedef void (*action_handler)(struct host1x_waitlist *waiter);
139 struct host1x_waitlist *waiter, *next; in run_handlers() local
141 list_for_each_entry_safe(waiter, next, head, list) { in run_handlers()
142 list_del(&waiter->list); in run_handlers()
143 handler(waiter); in run_handlers()
144 WARN_ON(atomic_xchg(&waiter->state, WLS_HANDLED) != in run_handlers()
146 kref_put(&waiter->refcount, waiter_release); in run_handlers()
204 void *data, struct host1x_waitlist *waiter, in host1x_intr_add_action() argument
209 if (waiter == NULL) { in host1x_intr_add_action()
215 INIT_LIST_HEAD(&waiter->list); in host1x_intr_add_action()
216 kref_init(&waiter->refcount); in host1x_intr_add_action()
218 kref_get(&waiter->refcount); in host1x_intr_add_action()
219 waiter->thresh = thresh; in host1x_intr_add_action()
220 waiter->action = action; in host1x_intr_add_action()
221 atomic_set(&waiter->state, WLS_PENDING); in host1x_intr_add_action()
222 waiter->data = data; in host1x_intr_add_action()
223 waiter->count = 1; in host1x_intr_add_action()
229 if (add_waiter_to_queue(waiter, &syncpt->intr.wait_head)) { in host1x_intr_add_action()
241 *ref = waiter; in host1x_intr_add_action()
247 struct host1x_waitlist *waiter = ref; in host1x_intr_put_ref() local
250 while (atomic_cmpxchg(&waiter->state, WLS_PENDING, WLS_CANCELLED) == in host1x_intr_put_ref()
258 kref_put(&waiter->refcount, waiter_release); in host1x_intr_put_ref()
315 struct host1x_waitlist *waiter, *next; in host1x_intr_stop() local
317 list_for_each_entry_safe(waiter, next, in host1x_intr_stop()
319 if (atomic_cmpxchg(&waiter->state, in host1x_intr_stop()
321 list_del(&waiter->list); in host1x_intr_stop()
322 kref_put(&waiter->refcount, waiter_release); in host1x_intr_stop()