Subject: [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs

From: [email-masked] (Will Deacon)
Date: Thu, 25 May 2017 11:58:32 +0100

On Wed, May 24, 2017 at 11:09:49AM +0100, Mark Rutland wrote:
> On Tue, May 09, 2017 at 09:53:37AM +0800, Kefeng Wang wrote:
> > Generic code expects show_regs() to dump the stack, but arm64's
> > show_regs() does not. This makes it hard to debug softlockups and
> > other issues that result in show_regs() being called.
> > 
> > This patch updates arm64's show_regs() to dump the stack, as common
> > code expects.
> > 
> > Acked-by: Mark Rutland <[email-masked]>
> > Signed-off-by: Kefeng Wang <[email-masked]>

[...]

> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 0805b44..f452fcc 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -728,8 +728,6 @@ static int bug_handler(struct pt_regs *regs, unsigned int esr)
>                 break;
>  
>         case BUG_TRAP_TYPE_WARN:
> -               /* Ideally, report_bug() should backtrace for us... but no. */
> -               dump_backtrace(regs, NULL);
>                 break;
>  
>         default:
> 
> ... since report_bug() will call show_regs(), and dump the stack itself
> now.
> 
> With that change, these patches will also fix *_ONCE() traps spewing
> backtraces every time they're invoked, which was a side-effect of
> commit:
> 
>   19d436268dde9538 ("debug: Add _ONCE() logic to report_bug()")
> 
> Would you mind folding that into a v3?

I've queued this locally, so I can just fold that in too. No need to repost.

I'll push what I have at -rc3.

Cheers,

Will