linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 宋金时 <songjinshi@xiaomi.com>
To: Todd Kjos <tkjos@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Martijn Coenen" <maco@android.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: 答复: [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR
Date: Thu, 10 May 2018 02:41:21 +0000	[thread overview]
Message-ID: <1525920081130.81742@xiaomi.com> (raw)
In-Reply-To: <CAHRSSEwjH=GyxR7E0WhpDb9so_Lc=3-M=2-zmYhptViX5=ZSTg@mail.gmail.com>

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

      reply	other threads:[~2018-05-10  2:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1525920081130.81742@xiaomi.com \
    --to=songjinshi@xiaomi.com \
    --cc=arve@android.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=tkjos@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).