Lines Matching refs:waiter

47 static bool add_waiter_to_queue(struct host1x_waitlist *waiter,  in add_waiter_to_queue()  argument
51 u32 thresh = waiter->thresh; in add_waiter_to_queue()
55 list_add(&waiter->list, &pos->list); in add_waiter_to_queue()
59 list_add(&waiter->list, queue); in add_waiter_to_queue()
71 struct host1x_waitlist *waiter, *next, *prev; in remove_completed_waiters() local
73 list_for_each_entry_safe(waiter, next, head, list) { in remove_completed_waiters()
74 if ((s32)(waiter->thresh - sync) > 0) in remove_completed_waiters()
77 dest = completed + waiter->action; in remove_completed_waiters()
80 if (waiter->action == HOST1X_INTR_ACTION_SUBMIT_COMPLETE && in remove_completed_waiters()
84 if (prev->data == waiter->data) { in remove_completed_waiters()
91 if (atomic_inc_return(&waiter->state) == WLS_HANDLED || !dest) { in remove_completed_waiters()
92 list_del(&waiter->list); in remove_completed_waiters()
93 kref_put(&waiter->refcount, waiter_release); in remove_completed_waiters()
95 list_move_tail(&waiter->list, dest); in remove_completed_waiters()
110 static void action_submit_complete(struct host1x_waitlist *waiter) in action_submit_complete() argument
112 struct host1x_channel *channel = waiter->data; in action_submit_complete()
118 waiter->count, waiter->thresh); in action_submit_complete()
122 static void action_wakeup(struct host1x_waitlist *waiter) in action_wakeup() argument
124 wait_queue_head_t *wq = waiter->data; in action_wakeup()
128 static void action_wakeup_interruptible(struct host1x_waitlist *waiter) in action_wakeup_interruptible() argument
130 wait_queue_head_t *wq = waiter->data; in action_wakeup_interruptible()
134 typedef void (*action_handler)(struct host1x_waitlist *waiter);
149 struct host1x_waitlist *waiter, *next; in run_handlers() local
151 list_for_each_entry_safe(waiter, next, head, list) { in run_handlers()
152 list_del(&waiter->list); in run_handlers()
153 handler(waiter); in run_handlers()
154 WARN_ON(atomic_xchg(&waiter->state, WLS_HANDLED) != in run_handlers()
156 kref_put(&waiter->refcount, waiter_release); in run_handlers()
214 struct host1x_waitlist *waiter, void **ref) in host1x_intr_add_action() argument
219 if (waiter == NULL) { in host1x_intr_add_action()
225 INIT_LIST_HEAD(&waiter->list); in host1x_intr_add_action()
226 kref_init(&waiter->refcount); in host1x_intr_add_action()
228 kref_get(&waiter->refcount); in host1x_intr_add_action()
229 waiter->thresh = thresh; in host1x_intr_add_action()
230 waiter->action = action; in host1x_intr_add_action()
231 atomic_set(&waiter->state, WLS_PENDING); in host1x_intr_add_action()
232 waiter->data = data; in host1x_intr_add_action()
233 waiter->count = 1; in host1x_intr_add_action()
241 if (add_waiter_to_queue(waiter, &syncpt->intr.wait_head)) { in host1x_intr_add_action()
253 *ref = waiter; in host1x_intr_add_action()
259 struct host1x_waitlist *waiter = ref; in host1x_intr_put_ref() local
262 while (atomic_cmpxchg(&waiter->state, WLS_PENDING, WLS_CANCELLED) == in host1x_intr_put_ref()
270 kref_put(&waiter->refcount, waiter_release); in host1x_intr_put_ref()
331 struct host1x_waitlist *waiter, *next; in host1x_intr_stop() local
333 list_for_each_entry_safe(waiter, next, in host1x_intr_stop()
335 if (atomic_cmpxchg(&waiter->state, in host1x_intr_stop()
337 list_del(&waiter->list); in host1x_intr_stop()
338 kref_put(&waiter->refcount, waiter_release); in host1x_intr_stop()