From 1e04bdae1c56ae84097f39960cef8de0ac6144e2 Mon Sep 17 00:00:00 2001 From: Florian Leeber Date: Wed, 7 Sep 2022 22:24:04 +0200 Subject: [PATCH 1/2] (halium) binder: do not use a separate queue for async oneway transaction --- drivers/android/binder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 21c8e3c48a0c..750f3aa7d910 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2797,7 +2797,8 @@ static bool binder_proc_transaction(struct binder_transaction *t, if (oneway) { BUG_ON(thread); if (node->has_async_transaction) { - pending_async = true; + // Halium: possible libgbinder bug workaround + /*pending_async = true;*/ } else { node->has_async_transaction = true; } @@ -3659,7 +3660,8 @@ static int binder_thread_write(struct binder_proc *proc, buf_node = buffer->target_node; binder_node_inner_lock(buf_node); - BUG_ON(!buf_node->has_async_transaction); + // Halium: possible libgbinder bug workaround + /*BUG_ON(!buf_node->has_async_transaction);*/ BUG_ON(buf_node->proc != proc); w = binder_dequeue_work_head_ilocked( &buf_node->async_todo); From 99d3a9878bbc13f136ff7b034bf5240a335f51e8 Mon Sep 17 00:00:00 2001 From: Florian Leeber Date: Wed, 7 Sep 2022 22:27:45 +0200 Subject: [PATCH 2/2] Use gbinder workaround only for hwbinder context --- drivers/android/binder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 750f3aa7d910..be5c2c8cb185 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2797,8 +2797,11 @@ static bool binder_proc_transaction(struct binder_transaction *t, if (oneway) { BUG_ON(thread); if (node->has_async_transaction) { - // Halium: possible libgbinder bug workaround - /*pending_async = true;*/ + if (!strcmp(proc->context->name, "hwbinder")) { + // Halium: possible libgbinder bug workaround + } else { + pending_async = true; + } } else { node->has_async_transaction = true; }