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()
111 static void action_wakeup(struct host1x_waitlist *waiter) in action_wakeup() argument
113 wait_queue_head_t *wq = waiter->data; in action_wakeup()
118 static void action_wakeup_interruptible(struct host1x_waitlist *waiter) in action_wakeup_interruptible() argument
120 wait_queue_head_t *wq = waiter->data; in action_wakeup_interruptible()
125 typedef void (*action_handler)(struct host1x_waitlist *waiter);
140 struct host1x_waitlist *waiter, *next; in run_handlers() local
142 list_for_each_entry_safe(waiter, next, head, list) { in run_handlers()
143 list_del(&waiter->list); in run_handlers()
144 handler(waiter); in run_handlers()
145 WARN_ON(atomic_xchg(&waiter->state, WLS_HANDLED) != in run_handlers()
147 kref_put(&waiter->refcount, waiter_release); in run_handlers()
205 void *data, struct host1x_waitlist *waiter, in host1x_intr_add_action() argument
210 if (waiter == NULL) { in host1x_intr_add_action()
216 INIT_LIST_HEAD(&waiter->list); in host1x_intr_add_action()
217 kref_init(&waiter->refcount); in host1x_intr_add_action()
219 kref_get(&waiter->refcount); in host1x_intr_add_action()
220 waiter->thresh = thresh; in host1x_intr_add_action()
221 waiter->action = action; in host1x_intr_add_action()
222 atomic_set(&waiter->state, WLS_PENDING); in host1x_intr_add_action()
223 waiter->data = data; in host1x_intr_add_action()
224 waiter->count = 1; in host1x_intr_add_action()
230 if (add_waiter_to_queue(waiter, &syncpt->intr.wait_head)) { in host1x_intr_add_action()
242 *ref = waiter; in host1x_intr_add_action()
248 struct host1x_waitlist *waiter = ref; in host1x_intr_put_ref() local
251 while (atomic_cmpxchg(&waiter->state, WLS_PENDING, WLS_CANCELLED) == in host1x_intr_put_ref()
259 kref_put(&waiter->refcount, waiter_release); in host1x_intr_put_ref()
316 struct host1x_waitlist *waiter, *next; in host1x_intr_stop() local
318 list_for_each_entry_safe(waiter, next, in host1x_intr_stop()
320 if (atomic_cmpxchg(&waiter->state, in host1x_intr_stop()
322 list_del(&waiter->list); in host1x_intr_stop()
323 kref_put(&waiter->refcount, waiter_release); in host1x_intr_stop()