All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR
@ 2018-05-09  7:31 宋金时
  2018-05-09 18:08 ` Todd Kjos
  0 siblings, 1 reply; 3+ messages in thread
From: 宋金时 @ 2018-05-09  7:31 UTC (permalink / raw)
  To: gregkh, maco, tkjos, arve; +Cc: linux-kernel

In case of the BINDER_WORK_RETURN_ERROR the cmd is no assignment,
so it's value will be old value or dirty value, before modifying
e->cmd, assign the value of the e->cmd to cmd to ensure the correct
print of binder_stat_br.

Signed-off-by: songjinshi <songjinshi@xiaomi.com>
---

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 4ffc84d..acd7d44a 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4086,6 +4086,7 @@
 			struct binder_error *e = container_of(
 					w, struct binder_error, work);
 
+			cmd = e->cmd;
 			WARN_ON(e->cmd == BR_OK);
 			binder_inner_proc_unlock(proc);
 			if (put_user(e->cmd, (uint32_t __user *)ptr))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR
  2018-05-09  7:31 [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR 宋金时
@ 2018-05-09 18:08 ` Todd Kjos
  2018-05-10  2:41   ` 答复: " 宋金时
  0 siblings, 1 reply; 3+ messages in thread
From: Todd Kjos @ 2018-05-09 18:08 UTC (permalink / raw)
  To: 宋金时
  Cc: Greg Kroah-Hartman, Martijn Coenen, Arve Hjønnevåg, LKML

On Wed, May 9, 2018 at 12:31 AM 宋金时 <songjinshi@xiaomi.com> wrote:

> In case of the BINDER_WORK_RETURN_ERROR the cmd is no assignment,
> so it's value will be old value or dirty value, before modifying
> e->cmd, assign the value of the e->cmd to cmd to ensure the correct
> print of binder_stat_br.


That's not the problem... the problem is that e->cmd is unconditionally set
to BR_OK prior to the call to binder_stat_br(proc, thread, e->cmd) so the
reported cmd is always BR_OK.


> Signed-off-by: songjinshi <songjinshi@xiaomi.com>
> ---

> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 4ffc84d..acd7d44a 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -4086,6 +4086,7 @@
>                          struct binder_error *e = container_of(
>                                          w, struct binder_error, work);

> +                       cmd = e->cmd;
>                          WARN_ON(e->cmd == BR_OK);
>                          binder_inner_proc_unlock(proc);
>                          if (put_user(e->cmd, (uint32_t __user *)ptr))


Don't you also need to use cmd in the call to binder_state_br() below?

-                       binder_stat_br(proc, thread, e->cmd);
+                       binder_stat_br(proc, thread, cmd);

-Todd

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 答复: [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR
  2018-05-09 18:08 ` Todd Kjos
@ 2018-05-10  2:41   ` 宋金时
  0 siblings, 0 replies; 3+ messages in thread
From: 宋金时 @ 2018-05-10  2:41 UTC (permalink / raw)
  To: Todd Kjos
  Cc: Greg Kroah-Hartman, Martijn Coenen, Arve Hjønnevåg, LKML

OK,this patch is based on the downstream android kernel4.4 version, not yet include the latest changes, let me update the patch to base on the latest upstream, Tks.

________________________________________
发件人: Todd Kjos <tkjos@google.com>
发送时间: 2018年5月10日 2:08
收件人: 宋金时
抄送: Greg Kroah-Hartman; Martijn Coenen; Arve Hjønnevåg; LKML
主题: Re: [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR

On Wed, May 9, 2018 at 12:31 AM 宋金时 <songjinshi@xiaomi.com> wrote:

> In case of the BINDER_WORK_RETURN_ERROR the cmd is no assignment,
> so it's value will be old value or dirty value, before modifying
> e->cmd, assign the value of the e->cmd to cmd to ensure the correct
> print of binder_stat_br.


That's not the problem... the problem is that e->cmd is unconditionally set
to BR_OK prior to the call to binder_stat_br(proc, thread, e->cmd) so the
reported cmd is always BR_OK.


> Signed-off-by: songjinshi <songjinshi@xiaomi.com>
> ---

> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 4ffc84d..acd7d44a 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -4086,6 +4086,7 @@
>                          struct binder_error *e = container_of(
>                                          w, struct binder_error, work);

> +                       cmd = e->cmd;
>                          WARN_ON(e->cmd == BR_OK);
>                          binder_inner_proc_unlock(proc);
>                          if (put_user(e->cmd, (uint32_t __user *)ptr))


Don't you also need to use cmd in the call to binder_state_br() below?

-                       binder_stat_br(proc, thread, e->cmd);
+                       binder_stat_br(proc, thread, cmd);

-Todd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-10  2:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09  7:31 [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR 宋金时
2018-05-09 18:08 ` Todd Kjos
2018-05-10  2:41   ` 答复: " 宋金时

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.