Lines Matching refs:thread
462 binder_enqueue_deferred_thread_work_ilocked(struct binder_thread *thread, in binder_enqueue_deferred_thread_work_ilocked() argument
465 WARN_ON(!list_empty(&thread->waiting_thread_node)); in binder_enqueue_deferred_thread_work_ilocked()
466 binder_enqueue_work_ilocked(work, &thread->todo); in binder_enqueue_deferred_thread_work_ilocked()
480 binder_enqueue_thread_work_ilocked(struct binder_thread *thread, in binder_enqueue_thread_work_ilocked() argument
483 WARN_ON(!list_empty(&thread->waiting_thread_node)); in binder_enqueue_thread_work_ilocked()
484 binder_enqueue_work_ilocked(work, &thread->todo); in binder_enqueue_thread_work_ilocked()
491 if (thread->looper & BINDER_LOOPER_STATE_POLL && in binder_enqueue_thread_work_ilocked()
492 thread->pid == current->pid && !thread->process_todo) in binder_enqueue_thread_work_ilocked()
493 wake_up_interruptible_sync(&thread->wait); in binder_enqueue_thread_work_ilocked()
495 thread->process_todo = true; in binder_enqueue_thread_work_ilocked()
507 binder_enqueue_thread_work(struct binder_thread *thread, in binder_enqueue_thread_work() argument
510 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
511 binder_enqueue_thread_work_ilocked(thread, work); in binder_enqueue_thread_work()
512 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
550 static void binder_free_thread(struct binder_thread *thread);
554 static bool binder_has_work_ilocked(struct binder_thread *thread, in binder_has_work_ilocked() argument
557 return thread->process_todo || in binder_has_work_ilocked()
558 thread->looper_need_return || in binder_has_work_ilocked()
560 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
563 static bool binder_has_work(struct binder_thread *thread, bool do_proc_work) in binder_has_work() argument
567 binder_inner_proc_lock(thread->proc); in binder_has_work()
568 has_work = binder_has_work_ilocked(thread, do_proc_work); in binder_has_work()
569 binder_inner_proc_unlock(thread->proc); in binder_has_work()
574 static bool binder_available_for_proc_work_ilocked(struct binder_thread *thread) in binder_available_for_proc_work_ilocked() argument
576 return !thread->transaction_stack && in binder_available_for_proc_work_ilocked()
577 binder_worklist_empty_ilocked(&thread->todo); in binder_available_for_proc_work_ilocked()
584 struct binder_thread *thread; in binder_wakeup_poll_threads_ilocked() local
587 thread = rb_entry(n, struct binder_thread, rb_node); in binder_wakeup_poll_threads_ilocked()
588 if (thread->looper & BINDER_LOOPER_STATE_POLL && in binder_wakeup_poll_threads_ilocked()
589 binder_available_for_proc_work_ilocked(thread)) { in binder_wakeup_poll_threads_ilocked()
591 wake_up_interruptible_sync(&thread->wait); in binder_wakeup_poll_threads_ilocked()
593 wake_up_interruptible(&thread->wait); in binder_wakeup_poll_threads_ilocked()
613 struct binder_thread *thread; in binder_select_thread_ilocked() local
616 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
620 if (thread) in binder_select_thread_ilocked()
621 list_del_init(&thread->waiting_thread_node); in binder_select_thread_ilocked()
623 return thread; in binder_select_thread_ilocked()
643 struct binder_thread *thread, in binder_wakeup_thread_ilocked() argument
648 if (thread) { in binder_wakeup_thread_ilocked()
650 wake_up_interruptible_sync(&thread->wait); in binder_wakeup_thread_ilocked()
652 wake_up_interruptible(&thread->wait); in binder_wakeup_thread_ilocked()
674 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked() local
676 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
843 struct binder_thread *thread = container_of(target_list, in binder_inc_node_nilocked() local
846 BUG_ON(&thread->todo != target_list); in binder_inc_node_nilocked()
847 binder_enqueue_deferred_thread_work_ilocked(thread, in binder_inc_node_nilocked()
1534 static void binder_thread_dec_tmpref(struct binder_thread *thread) in binder_thread_dec_tmpref() argument
1540 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1541 atomic_dec(&thread->tmp_ref); in binder_thread_dec_tmpref()
1542 if (thread->is_dead && !atomic_read(&thread->tmp_ref)) { in binder_thread_dec_tmpref()
1543 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1544 binder_free_thread(thread); in binder_thread_dec_tmpref()
1547 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
2036 struct binder_thread *thread, in binder_transaction_buffer_release() argument
2200 if (thread) in binder_transaction_buffer_release()
2201 thread->looper_need_return = true; in binder_transaction_buffer_release()
2215 struct binder_thread *thread, in binder_release_entire_buffer() argument
2224 binder_transaction_buffer_release(proc, thread, buffer, in binder_release_entire_buffer()
2230 struct binder_thread *thread) in binder_translate_binder() argument
2233 struct binder_proc *proc = thread->proc; in binder_translate_binder()
2246 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2259 &thread->todo, &rdata); in binder_translate_binder()
2283 struct binder_thread *thread) in binder_translate_handle() argument
2285 struct binder_proc *proc = thread->proc; in binder_translate_handle()
2295 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2356 struct binder_thread *thread, in binder_translate_fd() argument
2359 struct binder_proc *proc = thread->proc; in binder_translate_fd()
2372 proc->pid, thread->pid, in binder_translate_fd()
2382 proc->pid, thread->pid, fd); in binder_translate_fd()
2667 struct binder_thread *thread, in binder_translate_fd_array() argument
2673 struct binder_proc *proc = thread->proc; in binder_translate_fd_array()
2682 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2689 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2707 proc->pid, thread->pid); in binder_translate_fd_array()
2721 ret = binder_translate_fd(fd, offset, t, thread, in binder_translate_fd_array()
2731 struct binder_thread *thread, in binder_fixup_parent() argument
2740 struct binder_proc *proc = thread->proc; in binder_fixup_parent()
2754 proc->pid, thread->pid); in binder_fixup_parent()
2763 proc->pid, thread->pid); in binder_fixup_parent()
2771 proc->pid, thread->pid); in binder_fixup_parent()
2853 struct binder_thread *thread) in binder_proc_transaction() argument
2864 BUG_ON(thread); in binder_proc_transaction()
2879 (thread && thread->is_dead)) { in binder_proc_transaction()
2885 if (!thread && !pending_async) in binder_proc_transaction()
2886 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
2888 if (thread) { in binder_proc_transaction()
2889 binder_enqueue_thread_work_ilocked(thread, &t->work); in binder_proc_transaction()
2908 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
2997 struct binder_thread *thread, in binder_transaction() argument
3035 e->from_thread = thread->pid; in binder_transaction()
3042 binder_set_extended_error(&thread->ee, t_debug_id, BR_OK, 0); in binder_transaction()
3047 in_reply_to = thread->transaction_stack; in binder_transaction()
3051 proc->pid, thread->pid); in binder_transaction()
3057 if (in_reply_to->to_thread != thread) { in binder_transaction()
3060 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
3073 thread->transaction_stack = in_reply_to->to_parent; in binder_transaction()
3081 thread->pid, proc->pid); in binder_transaction()
3088 proc->pid, thread->pid, in binder_transaction()
3123 proc->pid, thread->pid, tr->target.handle); in binder_transaction()
3139 proc->pid, thread->pid); in binder_transaction()
3148 proc->pid, thread->pid); in binder_transaction()
3157 thread->pid, proc->pid); in binder_transaction()
3166 thread->pid, proc->pid); in binder_transaction()
3174 w = list_first_entry_or_null(&thread->todo, in binder_transaction()
3188 proc->pid, thread->pid); in binder_transaction()
3196 if (!(tr->flags & TF_ONE_WAY) && thread->transaction_stack) { in binder_transaction()
3199 tmp = thread->transaction_stack; in binder_transaction()
3200 if (tmp->to_thread != thread) { in binder_transaction()
3203 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3239 thread->pid, proc->pid); in binder_transaction()
3252 thread->pid, proc->pid); in binder_transaction()
3266 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3273 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3279 t->from = thread; in binder_transaction()
3283 t->from_tid = thread->pid; in binder_transaction()
3299 thread->pid, proc->pid); in binder_transaction()
3309 thread->pid, proc->pid); in binder_transaction()
3371 proc->pid, thread->pid); in binder_transaction()
3379 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3387 proc->pid, thread->pid, in binder_transaction()
3415 thread->pid, proc->pid); in binder_transaction()
3435 proc->pid, thread->pid); in binder_transaction()
3445 proc->pid, thread->pid, in binder_transaction()
3468 ret = binder_translate_binder(fp, t, thread); in binder_transaction()
3476 thread->pid, proc->pid); in binder_transaction()
3488 ret = binder_translate_handle(fp, t, thread); in binder_transaction()
3495 thread->pid, proc->pid); in binder_transaction()
3508 thread, in_reply_to); in binder_transaction()
3517 thread->pid, proc->pid); in binder_transaction()
3541 proc->pid, thread->pid); in binder_transaction()
3554 proc->pid, thread->pid); in binder_transaction()
3569 proc->pid, thread->pid, in binder_transaction()
3580 thread, in_reply_to); in binder_transaction()
3588 thread->pid, proc->pid); in binder_transaction()
3606 proc->pid, thread->pid); in binder_transaction()
3617 thread->pid, proc->pid); in binder_transaction()
3630 thread, bp, in binder_transaction()
3641 thread->pid, proc->pid); in binder_transaction()
3652 proc->pid, thread->pid, hdr->type); in binder_transaction()
3666 proc->pid, thread->pid); in binder_transaction()
3677 proc->pid, thread->pid); in binder_transaction()
3690 binder_enqueue_thread_work(thread, tcomplete); in binder_transaction()
3714 binder_enqueue_deferred_thread_work_ilocked(thread, tcomplete); in binder_transaction()
3716 t->from_parent = thread->transaction_stack; in binder_transaction()
3717 thread->transaction_stack = t; in binder_transaction()
3723 binder_pop_transaction_ilocked(thread, t); in binder_transaction()
3738 binder_enqueue_thread_work(thread, tcomplete); in binder_transaction()
3758 thread->pid, proc->pid); in binder_transaction()
3801 proc->pid, thread->pid, reply ? "reply" : in binder_transaction()
3831 BUG_ON(thread->return_error.cmd != BR_OK); in binder_transaction()
3835 thread->return_error.cmd = BR_TRANSACTION_COMPLETE; in binder_transaction()
3836 binder_enqueue_thread_work(thread, &thread->return_error.work); in binder_transaction()
3840 binder_set_extended_error(&thread->ee, t_debug_id, in binder_transaction()
3843 thread->return_error.cmd = return_error; in binder_transaction()
3844 binder_enqueue_thread_work(thread, &thread->return_error.work); in binder_transaction()
3850 struct binder_thread *thread, in binder_request_freeze_notification() argument
3863 proc->pid, thread->pid, handle_cookie->handle); in binder_request_freeze_notification()
3872 proc->pid, thread->pid); in binder_request_freeze_notification()
3903 struct binder_thread *thread, in binder_clear_freeze_notification() argument
3913 proc->pid, thread->pid, handle_cookie->handle); in binder_clear_freeze_notification()
3922 proc->pid, thread->pid); in binder_clear_freeze_notification()
3931 proc->pid, thread->pid, (u64)freeze->cookie, in binder_clear_freeze_notification()
3962 struct binder_thread *thread, in binder_freeze_notification_done() argument
3980 proc->pid, thread->pid, (u64)cookie); in binder_freeze_notification_done()
4008 struct binder_thread *thread, in binder_free_buf() argument
4037 binder_release_entire_buffer(proc, thread, buffer, is_failure); in binder_free_buf()
4042 struct binder_thread *thread, in binder_thread_write() argument
4052 while (ptr < end && thread->return_error.cmd == BR_OK) { in binder_thread_write()
4062 atomic_inc(&thread->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
4088 proc->pid, thread->pid); in binder_thread_write()
4104 proc->pid, thread->pid, in binder_thread_write()
4124 proc->pid, thread->pid, debug_string, in binder_thread_write()
4130 proc->pid, thread->pid, debug_string, in binder_thread_write()
4151 proc->pid, thread->pid, in binder_thread_write()
4160 proc->pid, thread->pid, in binder_thread_write()
4172 proc->pid, thread->pid, in binder_thread_write()
4182 proc->pid, thread->pid, in binder_thread_write()
4195 proc->pid, thread->pid, in binder_thread_write()
4224 proc->pid, thread->pid, in binder_thread_write()
4229 proc->pid, thread->pid, in binder_thread_write()
4236 proc->pid, thread->pid, in binder_thread_write()
4240 binder_free_buf(proc, thread, buffer, false); in binder_thread_write()
4251 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
4262 binder_transaction(proc, thread, &tr, in binder_thread_write()
4270 proc->pid, thread->pid); in binder_thread_write()
4272 if (thread->looper & BINDER_LOOPER_STATE_ENTERED) { in binder_thread_write()
4273 thread->looper |= BINDER_LOOPER_STATE_INVALID; in binder_thread_write()
4275 proc->pid, thread->pid); in binder_thread_write()
4277 thread->looper |= BINDER_LOOPER_STATE_INVALID; in binder_thread_write()
4279 proc->pid, thread->pid); in binder_thread_write()
4284 thread->looper |= BINDER_LOOPER_STATE_REGISTERED; in binder_thread_write()
4290 proc->pid, thread->pid); in binder_thread_write()
4291 if (thread->looper & BINDER_LOOPER_STATE_REGISTERED) { in binder_thread_write()
4292 thread->looper |= BINDER_LOOPER_STATE_INVALID; in binder_thread_write()
4294 proc->pid, thread->pid); in binder_thread_write()
4296 thread->looper |= BINDER_LOOPER_STATE_ENTERED; in binder_thread_write()
4301 proc->pid, thread->pid); in binder_thread_write()
4302 thread->looper |= BINDER_LOOPER_STATE_EXITED; in binder_thread_write()
4325 WARN_ON(thread->return_error.cmd != in binder_thread_write()
4327 thread->return_error.cmd = BR_ERROR; in binder_thread_write()
4329 thread, in binder_thread_write()
4330 &thread->return_error.work); in binder_thread_write()
4334 proc->pid, thread->pid); in binder_thread_write()
4342 proc->pid, thread->pid, in binder_thread_write()
4354 proc->pid, thread->pid, in binder_thread_write()
4366 proc->pid, thread->pid); in binder_thread_write()
4388 proc->pid, thread->pid); in binder_thread_write()
4396 proc->pid, thread->pid, in binder_thread_write()
4407 if (thread->looper & in binder_thread_write()
4411 thread, in binder_thread_write()
4453 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
4457 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
4464 if (thread->looper & in binder_thread_write()
4468 thread, &death->work); in binder_thread_write()
4486 error = binder_request_freeze_notification(proc, thread, in binder_thread_write()
4499 error = binder_clear_freeze_notification(proc, thread, &handle_cookie); in binder_thread_write()
4512 error = binder_freeze_notification_done(proc, thread, cookie); in binder_thread_write()
4519 proc->pid, thread->pid, cmd); in binder_thread_write()
4528 struct binder_thread *thread, uint32_t cmd) in binder_stat_br() argument
4534 atomic_inc(&thread->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4539 struct binder_thread *thread, in binder_put_node_cmd() argument
4560 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4562 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4569 static int binder_wait_for_work(struct binder_thread *thread, in binder_wait_for_work() argument
4573 struct binder_proc *proc = thread->proc; in binder_wait_for_work()
4578 prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE|TASK_FREEZABLE); in binder_wait_for_work()
4579 if (binder_has_work_ilocked(thread, do_proc_work)) in binder_wait_for_work()
4582 list_add(&thread->waiting_thread_node, in binder_wait_for_work()
4587 list_del_init(&thread->waiting_thread_node); in binder_wait_for_work()
4593 finish_wait(&thread->wait, &wait); in binder_wait_for_work()
4654 struct binder_thread *thread, in binder_thread_read() argument
4673 wait_for_proc_work = binder_available_for_proc_work_ilocked(thread); in binder_thread_read()
4676 thread->looper |= BINDER_LOOPER_STATE_WAITING; in binder_thread_read()
4679 !!thread->transaction_stack, in binder_thread_read()
4680 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4682 if (!(thread->looper & (BINDER_LOOPER_STATE_REGISTERED | in binder_thread_read()
4685 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4693 if (!binder_has_work(thread, wait_for_proc_work)) in binder_thread_read()
4696 ret = binder_wait_for_work(thread, wait_for_proc_work); in binder_thread_read()
4699 thread->looper &= ~BINDER_LOOPER_STATE_WAITING; in binder_thread_read()
4715 if (!binder_worklist_empty_ilocked(&thread->todo)) in binder_thread_read()
4716 list = &thread->todo; in binder_thread_read()
4724 if (ptr - buffer == 4 && !thread->looper_need_return) in binder_thread_read()
4734 if (binder_worklist_empty_ilocked(&thread->todo)) in binder_thread_read()
4735 thread->process_todo = false; in binder_thread_read()
4754 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4773 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4776 proc->pid, thread->pid); in binder_thread_read()
4814 proc->pid, thread->pid, in binder_thread_read()
4837 proc, thread, &ptr, node_ptr, in binder_thread_read()
4842 proc, thread, &ptr, node_ptr, in binder_thread_read()
4847 proc, thread, &ptr, node_ptr, in binder_thread_read()
4852 proc, thread, &ptr, node_ptr, in binder_thread_read()
4858 proc->pid, thread->pid, in binder_thread_read()
4881 proc->pid, thread->pid, in binder_thread_read()
4902 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4925 binder_stat_br(proc, thread, BR_FROZEN_BINDER); in binder_thread_read()
4943 binder_stat_br(proc, thread, BR_CLEAR_FREEZE_NOTIFICATION_DONE); in binder_thread_read()
4949 proc->pid, thread->pid, w->type); in binder_thread_read()
5001 binder_free_buf(proc, thread, buffer, true); in binder_thread_read()
5004 proc->pid, thread->pid, in binder_thread_read()
5013 binder_stat_br(proc, thread, cmd); in binder_thread_read()
5052 binder_stat_br(proc, thread, cmd); in binder_thread_read()
5055 proc->pid, thread->pid, in binder_thread_read()
5067 binder_inner_proc_lock(thread->proc); in binder_thread_read()
5068 t->to_parent = thread->transaction_stack; in binder_thread_read()
5069 t->to_thread = thread; in binder_thread_read()
5070 thread->transaction_stack = t; in binder_thread_read()
5071 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
5083 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
5085 (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | in binder_thread_read()
5092 proc->pid, thread->pid); in binder_thread_read()
5095 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
5175 struct binder_thread *thread = NULL; in binder_get_thread_ilocked() local
5181 thread = rb_entry(parent, struct binder_thread, rb_node); in binder_get_thread_ilocked()
5183 if (current->pid < thread->pid) in binder_get_thread_ilocked()
5185 else if (current->pid > thread->pid) in binder_get_thread_ilocked()
5188 return thread; in binder_get_thread_ilocked()
5192 thread = new_thread; in binder_get_thread_ilocked()
5194 thread->proc = proc; in binder_get_thread_ilocked()
5195 thread->pid = current->pid; in binder_get_thread_ilocked()
5196 atomic_set(&thread->tmp_ref, 0); in binder_get_thread_ilocked()
5197 init_waitqueue_head(&thread->wait); in binder_get_thread_ilocked()
5198 INIT_LIST_HEAD(&thread->todo); in binder_get_thread_ilocked()
5199 rb_link_node(&thread->rb_node, parent, p); in binder_get_thread_ilocked()
5200 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
5201 thread->looper_need_return = true; in binder_get_thread_ilocked()
5202 thread->return_error.work.type = BINDER_WORK_RETURN_ERROR; in binder_get_thread_ilocked()
5203 thread->return_error.cmd = BR_OK; in binder_get_thread_ilocked()
5204 thread->reply_error.work.type = BINDER_WORK_RETURN_ERROR; in binder_get_thread_ilocked()
5205 thread->reply_error.cmd = BR_OK; in binder_get_thread_ilocked()
5206 thread->ee.command = BR_OK; in binder_get_thread_ilocked()
5208 return thread; in binder_get_thread_ilocked()
5213 struct binder_thread *thread; in binder_get_thread() local
5217 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
5219 if (!thread) { in binder_get_thread()
5220 new_thread = kzalloc(sizeof(*thread), GFP_KERNEL); in binder_get_thread()
5224 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
5226 if (thread != new_thread) in binder_get_thread()
5229 return thread; in binder_get_thread()
5255 static void binder_free_thread(struct binder_thread *thread) in binder_free_thread() argument
5257 BUG_ON(!list_empty(&thread->todo)); in binder_free_thread()
5259 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
5260 kfree(thread); in binder_free_thread()
5264 struct binder_thread *thread) in binder_thread_release() argument
5271 binder_inner_proc_lock(thread->proc); in binder_thread_release()
5283 atomic_inc(&thread->tmp_ref); in binder_thread_release()
5284 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
5285 t = thread->transaction_stack; in binder_thread_release()
5288 if (t->to_thread == thread) in binder_thread_release()
5293 thread->is_dead = true; in binder_thread_release()
5300 proc->pid, thread->pid, in binder_thread_release()
5302 (t->to_thread == thread) ? "in" : "out"); in binder_thread_release()
5304 if (t->to_thread == thread) { in binder_thread_release()
5305 thread->proc->outstanding_txns--; in binder_thread_release()
5313 } else if (t->from == thread) { in binder_thread_release()
5331 if (thread->looper & BINDER_LOOPER_STATE_POLL) in binder_thread_release()
5332 wake_up_pollfree(&thread->wait); in binder_thread_release()
5334 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
5343 if (thread->looper & BINDER_LOOPER_STATE_POLL) in binder_thread_release()
5348 binder_release_work(proc, &thread->todo); in binder_thread_release()
5349 binder_thread_dec_tmpref(thread); in binder_thread_release()
5357 struct binder_thread *thread = NULL; in binder_poll() local
5360 thread = binder_get_thread(proc); in binder_poll()
5361 if (!thread) in binder_poll()
5364 binder_inner_proc_lock(thread->proc); in binder_poll()
5365 thread->looper |= BINDER_LOOPER_STATE_POLL; in binder_poll()
5366 wait_for_proc_work = binder_available_for_proc_work_ilocked(thread); in binder_poll()
5368 binder_inner_proc_unlock(thread->proc); in binder_poll()
5370 poll_wait(filp, &thread->wait, wait); in binder_poll()
5372 if (binder_has_work(thread, wait_for_proc_work)) in binder_poll()
5379 struct binder_thread *thread) in binder_ioctl_write_read() argument
5391 proc->pid, thread->pid, in binder_ioctl_write_read()
5396 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
5407 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
5421 proc->pid, thread->pid, in binder_ioctl_write_read()
5536 struct binder_thread *thread; in binder_txns_pending_ilocked() local
5542 thread = rb_entry(n, struct binder_thread, rb_node); in binder_txns_pending_ilocked()
5543 if (thread->transaction_stack) in binder_txns_pending_ilocked()
5681 static int binder_ioctl_get_extended_error(struct binder_thread *thread, in binder_ioctl_get_extended_error() argument
5686 binder_inner_proc_lock(thread->proc); in binder_ioctl_get_extended_error()
5687 ee = thread->ee; in binder_ioctl_get_extended_error()
5688 binder_set_extended_error(&thread->ee, 0, BR_OK, 0); in binder_ioctl_get_extended_error()
5689 binder_inner_proc_unlock(thread->proc); in binder_ioctl_get_extended_error()
5701 struct binder_thread *thread; in binder_ioctl() local
5710 thread = binder_get_thread(proc); in binder_ioctl()
5711 if (thread == NULL) { in binder_ioctl()
5718 ret = binder_ioctl_write_read(filp, arg, thread); in binder_ioctl()
5754 proc->pid, thread->pid); in binder_ioctl()
5755 binder_thread_release(proc, thread); in binder_ioctl()
5756 thread = NULL; in binder_ioctl()
5896 ret = binder_ioctl_get_extended_error(thread, ubuf); in binder_ioctl()
5906 if (thread) in binder_ioctl()
5907 thread->looper_need_return = false; in binder_ioctl()
6090 struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node); in binder_deferred_flush() local
6092 thread->looper_need_return = true; in binder_deferred_flush()
6093 if (thread->looper & BINDER_LOOPER_STATE_WAITING) { in binder_deferred_flush()
6094 wake_up_interruptible(&thread->wait); in binder_deferred_flush()
6219 struct binder_thread *thread; in binder_deferred_release() local
6221 thread = rb_entry(n, struct binder_thread, rb_node); in binder_deferred_release()
6224 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
6416 struct binder_thread *thread, in print_binder_thread_ilocked() argument
6425 thread->pid, thread->looper, in print_binder_thread_ilocked()
6426 thread->looper_need_return, in print_binder_thread_ilocked()
6427 atomic_read(&thread->tmp_ref)); in print_binder_thread_ilocked()
6429 t = thread->transaction_stack; in print_binder_thread_ilocked()
6431 if (t->from == thread) { in print_binder_thread_ilocked()
6432 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6435 } else if (t->to_thread == thread) { in print_binder_thread_ilocked()
6436 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6440 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6445 list_for_each_entry(w, &thread->todo, entry) { in print_binder_thread_ilocked()
6446 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
6713 struct binder_thread *thread; in print_binder_proc_stats() local
6727 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()