Lines Matching refs:thread
433 binder_enqueue_deferred_thread_work_ilocked(struct binder_thread *thread, in binder_enqueue_deferred_thread_work_ilocked() argument
436 WARN_ON(!list_empty(&thread->waiting_thread_node)); in binder_enqueue_deferred_thread_work_ilocked()
437 binder_enqueue_work_ilocked(work, &thread->todo); in binder_enqueue_deferred_thread_work_ilocked()
451 binder_enqueue_thread_work_ilocked(struct binder_thread *thread, in binder_enqueue_thread_work_ilocked() argument
454 WARN_ON(!list_empty(&thread->waiting_thread_node)); in binder_enqueue_thread_work_ilocked()
455 binder_enqueue_work_ilocked(work, &thread->todo); in binder_enqueue_thread_work_ilocked()
462 if (thread->looper & BINDER_LOOPER_STATE_POLL && in binder_enqueue_thread_work_ilocked()
463 thread->pid == current->pid && !thread->process_todo) in binder_enqueue_thread_work_ilocked()
464 wake_up_interruptible_sync(&thread->wait); in binder_enqueue_thread_work_ilocked()
466 thread->process_todo = true; in binder_enqueue_thread_work_ilocked()
478 binder_enqueue_thread_work(struct binder_thread *thread, in binder_enqueue_thread_work() argument
481 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
482 binder_enqueue_thread_work_ilocked(thread, work); in binder_enqueue_thread_work()
483 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
521 static void binder_free_thread(struct binder_thread *thread);
525 static bool binder_has_work_ilocked(struct binder_thread *thread, in binder_has_work_ilocked() argument
530 trace_android_vh_binder_has_work_ilocked(thread, do_proc_work, &ret); in binder_has_work_ilocked()
533 return thread->process_todo || in binder_has_work_ilocked()
534 thread->looper_need_return || in binder_has_work_ilocked()
536 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
539 static bool binder_has_work(struct binder_thread *thread, bool do_proc_work) in binder_has_work() argument
543 binder_inner_proc_lock(thread->proc); in binder_has_work()
544 has_work = binder_has_work_ilocked(thread, do_proc_work); in binder_has_work()
545 binder_inner_proc_unlock(thread->proc); in binder_has_work()
550 static bool binder_available_for_proc_work_ilocked(struct binder_thread *thread) in binder_available_for_proc_work_ilocked() argument
552 return !thread->transaction_stack && in binder_available_for_proc_work_ilocked()
553 binder_worklist_empty_ilocked(&thread->todo) && in binder_available_for_proc_work_ilocked()
554 (thread->looper & (BINDER_LOOPER_STATE_ENTERED | in binder_available_for_proc_work_ilocked()
562 struct binder_thread *thread; in binder_wakeup_poll_threads_ilocked() local
565 thread = rb_entry(n, struct binder_thread, rb_node); in binder_wakeup_poll_threads_ilocked()
566 if (thread->looper & BINDER_LOOPER_STATE_POLL && in binder_wakeup_poll_threads_ilocked()
567 binder_available_for_proc_work_ilocked(thread)) { in binder_wakeup_poll_threads_ilocked()
568 trace_android_vh_binder_wakeup_ilocked(thread->task, sync, proc); in binder_wakeup_poll_threads_ilocked()
570 wake_up_interruptible_sync(&thread->wait); in binder_wakeup_poll_threads_ilocked()
572 wake_up_interruptible(&thread->wait); in binder_wakeup_poll_threads_ilocked()
592 struct binder_thread *thread; in binder_select_thread_ilocked() local
595 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
599 if (thread) in binder_select_thread_ilocked()
600 list_del_init(&thread->waiting_thread_node); in binder_select_thread_ilocked()
602 return thread; in binder_select_thread_ilocked()
622 struct binder_thread *thread, in binder_wakeup_thread_ilocked() argument
627 if (thread) { in binder_wakeup_thread_ilocked()
628 trace_android_vh_binder_wakeup_ilocked(thread->task, sync, proc); in binder_wakeup_thread_ilocked()
630 wake_up_interruptible_sync(&thread->wait); in binder_wakeup_thread_ilocked()
632 wake_up_interruptible(&thread->wait); in binder_wakeup_thread_ilocked()
654 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked() local
656 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
957 struct binder_thread *thread = container_of(target_list, in binder_inc_node_nilocked() local
960 BUG_ON(&thread->todo != target_list); in binder_inc_node_nilocked()
961 binder_enqueue_deferred_thread_work_ilocked(thread, in binder_inc_node_nilocked()
1564 static void binder_thread_dec_tmpref(struct binder_thread *thread) in binder_thread_dec_tmpref() argument
1570 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1571 atomic_dec(&thread->tmp_ref); in binder_thread_dec_tmpref()
1572 if (thread->is_dead && !atomic_read(&thread->tmp_ref)) { in binder_thread_dec_tmpref()
1573 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1574 binder_free_thread(thread); in binder_thread_dec_tmpref()
1577 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
2048 struct binder_thread *thread, in binder_transaction_buffer_release() argument
2213 if (thread) in binder_transaction_buffer_release()
2214 thread->looper_need_return = true; in binder_transaction_buffer_release()
2228 struct binder_thread *thread, in binder_release_entire_buffer() argument
2237 binder_transaction_buffer_release(proc, thread, buffer, in binder_release_entire_buffer()
2243 struct binder_thread *thread) in binder_translate_binder() argument
2246 struct binder_proc *proc = thread->proc; in binder_translate_binder()
2259 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2273 &thread->todo, &rdata); in binder_translate_binder()
2297 struct binder_thread *thread) in binder_translate_handle() argument
2299 struct binder_proc *proc = thread->proc; in binder_translate_handle()
2309 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2371 struct binder_thread *thread, in binder_translate_fd() argument
2374 struct binder_proc *proc = thread->proc; in binder_translate_fd()
2387 proc->pid, thread->pid, in binder_translate_fd()
2397 proc->pid, thread->pid, fd); in binder_translate_fd()
2682 struct binder_thread *thread, in binder_translate_fd_array() argument
2688 struct binder_proc *proc = thread->proc; in binder_translate_fd_array()
2697 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2704 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2722 proc->pid, thread->pid); in binder_translate_fd_array()
2736 ret = binder_translate_fd(fd, offset, t, thread, in binder_translate_fd_array()
2746 struct binder_thread *thread, in binder_fixup_parent() argument
2755 struct binder_proc *proc = thread->proc; in binder_fixup_parent()
2769 proc->pid, thread->pid); in binder_fixup_parent()
2778 proc->pid, thread->pid); in binder_fixup_parent()
2786 proc->pid, thread->pid); in binder_fixup_parent()
2864 struct binder_thread *thread) in binder_proc_transaction() argument
2879 BUG_ON(thread); in binder_proc_transaction()
2893 (thread && thread->is_dead)) { in binder_proc_transaction()
2899 if (!thread && !pending_async) in binder_proc_transaction()
2900 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
2903 thread ? thread->task : NULL, node->debug_id, t->code, in binder_proc_transaction()
2906 if (thread) { in binder_proc_transaction()
2907 binder_transaction_priority(thread->task, t, node_prio, in binder_proc_transaction()
2909 binder_enqueue_thread_work_ilocked(thread, &t->work); in binder_proc_transaction()
2911 trace_android_vh_binder_special_task(t, proc, thread, in binder_proc_transaction()
2927 trace_android_vh_binder_special_task(t, proc, thread, in binder_proc_transaction()
2934 thread ? thread->task : NULL, t->code, pending_async, !oneway); in binder_proc_transaction()
2936 thread ? thread->task : NULL, pending_async, !oneway); in binder_proc_transaction()
2939 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
3007 struct binder_thread *thread, in binder_transaction() argument
3045 e->from_thread = thread->pid; in binder_transaction()
3053 in_reply_to = thread->transaction_stack; in binder_transaction()
3057 proc->pid, thread->pid); in binder_transaction()
3063 if (in_reply_to->to_thread != thread) { in binder_transaction()
3066 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
3079 thread->transaction_stack = in_reply_to->to_parent; in binder_transaction()
3091 proc->pid, thread->pid, in binder_transaction()
3106 trace_android_vh_binder_reply(target_proc, proc, thread, tr); in binder_transaction()
3127 proc->pid, thread->pid, tr->target.handle); in binder_transaction()
3143 proc->pid, thread->pid); in binder_transaction()
3159 trace_android_vh_binder_trans(target_proc, proc, thread, tr); in binder_transaction()
3169 w = list_first_entry_or_null(&thread->todo, in binder_transaction()
3183 proc->pid, thread->pid); in binder_transaction()
3191 if (!(tr->flags & TF_ONE_WAY) && thread->transaction_stack) { in binder_transaction()
3194 tmp = thread->transaction_stack; in binder_transaction()
3195 if (tmp->to_thread != thread) { in binder_transaction()
3198 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3229 trace_android_rvh_binder_transaction(target_proc, proc, thread, tr); in binder_transaction()
3258 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3267 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3275 t->from = thread; in binder_transaction()
3384 proc->pid, thread->pid); in binder_transaction()
3392 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3400 proc->pid, thread->pid, in binder_transaction()
3445 proc->pid, thread->pid); in binder_transaction()
3455 proc->pid, thread->pid, in binder_transaction()
3478 ret = binder_translate_binder(fp, t, thread); in binder_transaction()
3496 ret = binder_translate_handle(fp, t, thread); in binder_transaction()
3514 thread, in_reply_to); in binder_transaction()
3545 proc->pid, thread->pid); in binder_transaction()
3558 proc->pid, thread->pid); in binder_transaction()
3573 proc->pid, thread->pid, in binder_transaction()
3584 thread, in_reply_to); in binder_transaction()
3608 proc->pid, thread->pid); in binder_transaction()
3631 thread, bp, in binder_transaction()
3651 proc->pid, thread->pid, hdr->type); in binder_transaction()
3665 proc->pid, thread->pid); in binder_transaction()
3676 proc->pid, thread->pid); in binder_transaction()
3689 binder_enqueue_thread_work(thread, tcomplete); in binder_transaction()
3715 binder_enqueue_deferred_thread_work_ilocked(thread, tcomplete); in binder_transaction()
3717 t->from_parent = thread->transaction_stack; in binder_transaction()
3718 thread->transaction_stack = t; in binder_transaction()
3724 binder_pop_transaction_ilocked(thread, t); in binder_transaction()
3731 binder_enqueue_thread_work(thread, tcomplete); in binder_transaction()
3794 proc->pid, thread->pid, return_error, return_error_param, in binder_transaction()
3815 BUG_ON(thread->return_error.cmd != BR_OK); in binder_transaction()
3819 thread->return_error.cmd = BR_TRANSACTION_COMPLETE; in binder_transaction()
3820 binder_enqueue_thread_work(thread, &thread->return_error.work); in binder_transaction()
3823 thread->return_error.cmd = return_error; in binder_transaction()
3824 binder_enqueue_thread_work(thread, &thread->return_error.work); in binder_transaction()
3841 struct binder_thread *thread, in binder_free_buf() argument
3847 trace_android_vh_binder_free_buf(proc, thread, buffer); in binder_free_buf()
3868 trace_android_vh_binder_special_task(NULL, proc, thread, w, in binder_free_buf()
3876 trace_android_vh_binder_buffer_release(proc, thread, buffer, in binder_free_buf()
3879 binder_release_entire_buffer(proc, thread, buffer, is_failure); in binder_free_buf()
3884 struct binder_thread *thread, in binder_thread_write() argument
3894 while (ptr < end && thread->return_error.cmd == BR_OK) { in binder_thread_write()
3904 atomic_inc(&thread->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
3938 proc->pid, thread->pid, in binder_thread_write()
3958 proc->pid, thread->pid, debug_string, in binder_thread_write()
3964 proc->pid, thread->pid, debug_string, in binder_thread_write()
3985 proc->pid, thread->pid, in binder_thread_write()
3994 proc->pid, thread->pid, in binder_thread_write()
4006 proc->pid, thread->pid, in binder_thread_write()
4016 proc->pid, thread->pid, in binder_thread_write()
4029 proc->pid, thread->pid, in binder_thread_write()
4058 proc->pid, thread->pid, in binder_thread_write()
4063 proc->pid, thread->pid, in binder_thread_write()
4070 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
4073 binder_free_buf(proc, thread, buffer, false); in binder_thread_write()
4084 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
4095 binder_transaction(proc, thread, &tr, in binder_thread_write()
4103 proc->pid, thread->pid); in binder_thread_write()
4105 if (thread->looper & BINDER_LOOPER_STATE_ENTERED) { in binder_thread_write()
4106 thread->looper |= BINDER_LOOPER_STATE_INVALID; in binder_thread_write()
4108 proc->pid, thread->pid); in binder_thread_write()
4110 thread->looper |= BINDER_LOOPER_STATE_INVALID; in binder_thread_write()
4112 proc->pid, thread->pid); in binder_thread_write()
4117 thread->looper |= BINDER_LOOPER_STATE_REGISTERED; in binder_thread_write()
4119 trace_android_vh_binder_looper_state_registered(thread, proc); in binder_thread_write()
4124 proc->pid, thread->pid); in binder_thread_write()
4125 if (thread->looper & BINDER_LOOPER_STATE_REGISTERED) { in binder_thread_write()
4126 thread->looper |= BINDER_LOOPER_STATE_INVALID; in binder_thread_write()
4128 proc->pid, thread->pid); in binder_thread_write()
4130 thread->looper |= BINDER_LOOPER_STATE_ENTERED; in binder_thread_write()
4135 proc->pid, thread->pid); in binder_thread_write()
4136 thread->looper |= BINDER_LOOPER_STATE_EXITED; in binder_thread_write()
4159 WARN_ON(thread->return_error.cmd != in binder_thread_write()
4161 thread->return_error.cmd = BR_ERROR; in binder_thread_write()
4163 thread, in binder_thread_write()
4164 &thread->return_error.work); in binder_thread_write()
4168 proc->pid, thread->pid); in binder_thread_write()
4176 proc->pid, thread->pid, in binder_thread_write()
4188 proc->pid, thread->pid, in binder_thread_write()
4200 proc->pid, thread->pid); in binder_thread_write()
4222 proc->pid, thread->pid); in binder_thread_write()
4230 proc->pid, thread->pid, in binder_thread_write()
4241 if (thread->looper & in binder_thread_write()
4245 thread, in binder_thread_write()
4287 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
4291 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
4298 if (thread->looper & in binder_thread_write()
4302 thread, &death->work); in binder_thread_write()
4315 proc->pid, thread->pid, cmd); in binder_thread_write()
4324 struct binder_thread *thread, uint32_t cmd) in binder_stat_br() argument
4330 atomic_inc(&thread->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4335 struct binder_thread *thread, in binder_put_node_cmd() argument
4356 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4358 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4365 static int binder_wait_for_work(struct binder_thread *thread, in binder_wait_for_work() argument
4369 struct binder_proc *proc = thread->proc; in binder_wait_for_work()
4375 prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE); in binder_wait_for_work()
4376 if (binder_has_work_ilocked(thread, do_proc_work)) in binder_wait_for_work()
4379 list_add(&thread->waiting_thread_node, in binder_wait_for_work()
4381 trace_android_vh_binder_wait_for_work(do_proc_work, thread, proc); in binder_wait_for_work()
4385 list_del_init(&thread->waiting_thread_node); in binder_wait_for_work()
4391 finish_wait(&thread->wait, &wait); in binder_wait_for_work()
4464 struct binder_thread *thread, in binder_thread_read() argument
4483 wait_for_proc_work = binder_available_for_proc_work_ilocked(thread); in binder_thread_read()
4486 thread->looper |= BINDER_LOOPER_STATE_WAITING; in binder_thread_read()
4489 !!thread->transaction_stack, in binder_thread_read()
4490 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4492 if (!(thread->looper & (BINDER_LOOPER_STATE_REGISTERED | in binder_thread_read()
4495 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4504 if (!binder_has_work(thread, wait_for_proc_work)) in binder_thread_read()
4507 ret = binder_wait_for_work(thread, wait_for_proc_work); in binder_thread_read()
4510 thread->looper &= ~BINDER_LOOPER_STATE_WAITING; in binder_thread_read()
4526 if (!binder_worklist_empty_ilocked(&thread->todo)) in binder_thread_read()
4527 list = &thread->todo; in binder_thread_read()
4535 if (ptr - buffer == 4 && !thread->looper_need_return) in binder_thread_read()
4544 trace_android_vh_binder_thread_read(&list, proc, thread); in binder_thread_read()
4546 if (binder_worklist_empty_ilocked(&thread->todo)) in binder_thread_read()
4547 thread->process_todo = false; in binder_thread_read()
4566 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4582 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4585 proc->pid, thread->pid); in binder_thread_read()
4623 proc->pid, thread->pid, in binder_thread_read()
4646 proc, thread, &ptr, node_ptr, in binder_thread_read()
4651 proc, thread, &ptr, node_ptr, in binder_thread_read()
4656 proc, thread, &ptr, node_ptr, in binder_thread_read()
4661 proc, thread, &ptr, node_ptr, in binder_thread_read()
4667 proc->pid, thread->pid, in binder_thread_read()
4690 proc->pid, thread->pid, in binder_thread_read()
4711 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4718 proc->pid, thread->pid, w->type); in binder_thread_read()
4753 trace_android_vh_sync_txn_recvd(thread->task, t_from->task); in binder_thread_read()
4769 binder_free_buf(proc, thread, buffer, true); in binder_thread_read()
4772 proc->pid, thread->pid, in binder_thread_read()
4781 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4820 trace_android_vh_binder_transaction_received(t, proc, thread, cmd); in binder_thread_read()
4821 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4824 proc->pid, thread->pid, in binder_thread_read()
4838 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4839 t->to_parent = thread->transaction_stack; in binder_thread_read()
4840 t->to_thread = thread; in binder_thread_read()
4841 thread->transaction_stack = t; in binder_thread_read()
4842 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4854 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
4856 (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | in binder_thread_read()
4863 proc->pid, thread->pid); in binder_thread_read()
4866 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
4935 struct binder_thread *thread = NULL; in binder_get_thread_ilocked() local
4941 thread = rb_entry(parent, struct binder_thread, rb_node); in binder_get_thread_ilocked()
4943 if (current->pid < thread->pid) in binder_get_thread_ilocked()
4945 else if (current->pid > thread->pid) in binder_get_thread_ilocked()
4948 return thread; in binder_get_thread_ilocked()
4952 thread = new_thread; in binder_get_thread_ilocked()
4954 thread->proc = proc; in binder_get_thread_ilocked()
4955 thread->pid = current->pid; in binder_get_thread_ilocked()
4957 thread->task = current; in binder_get_thread_ilocked()
4958 atomic_set(&thread->tmp_ref, 0); in binder_get_thread_ilocked()
4959 init_waitqueue_head(&thread->wait); in binder_get_thread_ilocked()
4960 INIT_LIST_HEAD(&thread->todo); in binder_get_thread_ilocked()
4961 rb_link_node(&thread->rb_node, parent, p); in binder_get_thread_ilocked()
4962 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
4963 thread->looper_need_return = true; in binder_get_thread_ilocked()
4964 thread->return_error.work.type = BINDER_WORK_RETURN_ERROR; in binder_get_thread_ilocked()
4965 thread->return_error.cmd = BR_OK; in binder_get_thread_ilocked()
4966 thread->reply_error.work.type = BINDER_WORK_RETURN_ERROR; in binder_get_thread_ilocked()
4967 thread->reply_error.cmd = BR_OK; in binder_get_thread_ilocked()
4969 return thread; in binder_get_thread_ilocked()
4974 struct binder_thread *thread; in binder_get_thread() local
4978 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
4980 if (!thread) { in binder_get_thread()
4981 new_thread = kzalloc(sizeof(*thread), GFP_KERNEL); in binder_get_thread()
4985 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
4987 if (thread != new_thread) in binder_get_thread()
4990 return thread; in binder_get_thread()
5017 static void binder_free_thread(struct binder_thread *thread) in binder_free_thread() argument
5019 BUG_ON(!list_empty(&thread->todo)); in binder_free_thread()
5021 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
5022 put_task_struct(thread->task); in binder_free_thread()
5023 kfree(thread); in binder_free_thread()
5027 struct binder_thread *thread) in binder_thread_release() argument
5034 binder_inner_proc_lock(thread->proc); in binder_thread_release()
5046 atomic_inc(&thread->tmp_ref); in binder_thread_release()
5047 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
5048 t = thread->transaction_stack; in binder_thread_release()
5051 if (t->to_thread == thread) in binder_thread_release()
5056 thread->is_dead = true; in binder_thread_release()
5063 proc->pid, thread->pid, in binder_thread_release()
5065 (t->to_thread == thread) ? "in" : "out"); in binder_thread_release()
5067 if (t->to_thread == thread) { in binder_thread_release()
5068 thread->proc->outstanding_txns--; in binder_thread_release()
5076 } else if (t->from == thread) { in binder_thread_release()
5094 if (thread->looper & BINDER_LOOPER_STATE_POLL) in binder_thread_release()
5095 wake_up_pollfree(&thread->wait); in binder_thread_release()
5097 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
5106 if (thread->looper & BINDER_LOOPER_STATE_POLL) in binder_thread_release()
5111 binder_release_work(proc, &thread->todo); in binder_thread_release()
5112 trace_android_vh_binder_thread_release(proc, thread); in binder_thread_release()
5113 binder_thread_dec_tmpref(thread); in binder_thread_release()
5121 struct binder_thread *thread = NULL; in binder_poll() local
5124 thread = binder_get_thread(proc); in binder_poll()
5125 if (!thread) in binder_poll()
5128 binder_inner_proc_lock(thread->proc); in binder_poll()
5129 thread->looper |= BINDER_LOOPER_STATE_POLL; in binder_poll()
5130 wait_for_proc_work = binder_available_for_proc_work_ilocked(thread); in binder_poll()
5132 binder_inner_proc_unlock(thread->proc); in binder_poll()
5134 poll_wait(filp, &thread->wait, wait); in binder_poll()
5136 if (binder_has_work(thread, wait_for_proc_work)) in binder_poll()
5144 struct binder_thread *thread) in binder_ioctl_write_read() argument
5162 proc->pid, thread->pid, in binder_ioctl_write_read()
5167 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
5180 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
5189 trace_android_vh_binder_read_done(proc, thread); in binder_ioctl_write_read()
5198 proc->pid, thread->pid, in binder_ioctl_write_read()
5321 struct binder_thread *thread; in binder_txns_pending_ilocked() local
5327 thread = rb_entry(n, struct binder_thread, rb_node); in binder_txns_pending_ilocked()
5328 if (thread->transaction_stack) in binder_txns_pending_ilocked()
5416 struct binder_thread *thread; in binder_ioctl() local
5431 thread = binder_get_thread(proc); in binder_ioctl()
5432 if (thread == NULL) { in binder_ioctl()
5439 ret = binder_ioctl_write_read(filp, cmd, arg, thread); in binder_ioctl()
5475 proc->pid, thread->pid); in binder_ioctl()
5476 binder_thread_release(proc, thread); in binder_ioctl()
5477 thread = NULL; in binder_ioctl()
5626 if (thread) in binder_ioctl()
5627 thread->looper_need_return = false; in binder_ioctl()
5816 struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node); in binder_deferred_flush() local
5818 thread->looper_need_return = true; in binder_deferred_flush()
5819 if (thread->looper & BINDER_LOOPER_STATE_WAITING) { in binder_deferred_flush()
5820 wake_up_interruptible(&thread->wait); in binder_deferred_flush()
5945 struct binder_thread *thread; in binder_deferred_release() local
5947 thread = rb_entry(n, struct binder_thread, rb_node); in binder_deferred_release()
5950 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
6130 struct binder_thread *thread, in print_binder_thread_ilocked() argument
6139 thread->pid, thread->looper, in print_binder_thread_ilocked()
6140 thread->looper_need_return, in print_binder_thread_ilocked()
6141 atomic_read(&thread->tmp_ref)); in print_binder_thread_ilocked()
6143 t = thread->transaction_stack; in print_binder_thread_ilocked()
6145 if (t->from == thread) { in print_binder_thread_ilocked()
6146 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6149 } else if (t->to_thread == thread) { in print_binder_thread_ilocked()
6150 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6154 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6159 list_for_each_entry(w, &thread->todo, entry) { in print_binder_thread_ilocked()
6160 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
6378 struct binder_thread *thread; in print_binder_proc_stats() local
6392 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()