Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719862

[PATCH 10/13] ANDROID: binder: call poll_wait() unconditionally.

From Martijn Coenen <maco@android.com>
Newsgroups linux.kernel
Subject [PATCH 10/13] ANDROID: binder: call poll_wait() unconditionally.
Date 2017-08-25 11:40 +0200
Message-ID <uijfQ-2gM-19@gated-at.bofh.it> (permalink)
References <uijfQ-2gM-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Because we're not guaranteed that subsequent calls
to poll() will have a poll_table_struct parameter
with _qproc set. When _qproc is not set, poll_wait()
is a noop, and we won't be woken up correctly.

Signed-off-by: Martijn Coenen <maco@android.com>
---
 drivers/android/binder.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index eb82226be098..e8a70a7c789c 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3800,12 +3800,6 @@ static void binder_stat_br(struct binder_proc *proc,
 	}
 }
 
-static int binder_has_thread_work(struct binder_thread *thread)
-{
-	return !binder_worklist_empty(thread->proc, &thread->todo) ||
-		thread->looper_need_return;
-}
-
 static int binder_put_node_cmd(struct binder_proc *proc,
 			       struct binder_thread *thread,
 			       void __user **ptrp,
@@ -4436,12 +4430,9 @@ static unsigned int binder_poll(struct file *filp,
 
 	binder_inner_proc_unlock(thread->proc);
 
-	if (binder_has_work(thread, wait_for_proc_work))
-		return POLLIN;
-
 	poll_wait(filp, &thread->wait, wait);
 
-	if (binder_has_thread_work(thread))
+	if (binder_has_work(thread, wait_for_proc_work))
 		return POLLIN;
 
 	return 0;
-- 
2.14.1.480.gb18f417b89-goog

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 10/13] ANDROID: binder: call poll_wait() unconditionally. Martijn Coenen <maco@android.com> - 2017-08-25 11:40 +0200

csiph-web