public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH kernel] panic: Dump registers on panic_on_warn
@ 2020-06-30  9:38 Alexey Kardashevskiy
  2020-07-29  8:24 ` Alexey Kardashevskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kardashevskiy @ 2020-06-30  9:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexey Kardashevskiy, Nicholas Piggin

Currently we print stack and registers for ordinary warnings but
we do not for panic_on_warn which looks as oversight - panic()
will reboot the machine but won't print registers.

This moves printing of registers and modules earlier.

This does not move the stack dumping as panic() dumps it.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 kernel/panic.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index e2157ca387c8..798eff8156f3 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -589,6 +589,11 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 	if (args)
 		vprintk(args->fmt, args->args);
 
+	print_modules();
+
+	if (regs)
+		show_regs(regs);
+
 	if (panic_on_warn) {
 		/*
 		 * This thread may hit another WARN() in the panic path.
@@ -600,12 +605,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 		panic("panic_on_warn set ...\n");
 	}
 
-	print_modules();
-
-	if (regs)
-		show_regs(regs);
-	else
-		dump_stack();
+	dump_stack();
 
 	print_irqtrace_events(current);
 
-- 
2.17.1


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

* Re: [PATCH kernel] panic: Dump registers on panic_on_warn
  2020-06-30  9:38 [PATCH kernel] panic: Dump registers on panic_on_warn Alexey Kardashevskiy
@ 2020-07-29  8:24 ` Alexey Kardashevskiy
  2020-07-29  8:35   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kardashevskiy @ 2020-07-29  8:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Nicholas Piggin, Greg Kroah-Hartman

Ping?


On 30/06/2020 19:38, Alexey Kardashevskiy wrote:
> Currently we print stack and registers for ordinary warnings but
> we do not for panic_on_warn which looks as oversight - panic()
> will reboot the machine but won't print registers.
> 
> This moves printing of registers and modules earlier.
> 
> This does not move the stack dumping as panic() dumps it.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  kernel/panic.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index e2157ca387c8..798eff8156f3 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -589,6 +589,11 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
>  	if (args)
>  		vprintk(args->fmt, args->args);
>  
> +	print_modules();
> +
> +	if (regs)
> +		show_regs(regs);
> +
>  	if (panic_on_warn) {
>  		/*
>  		 * This thread may hit another WARN() in the panic path.
> @@ -600,12 +605,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
>  		panic("panic_on_warn set ...\n");
>  	}
>  
> -	print_modules();
> -
> -	if (regs)
> -		show_regs(regs);
> -	else
> -		dump_stack();
> +	dump_stack();
>  
>  	print_irqtrace_events(current);
>  
> 

-- 
Alexey

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

* Re: [PATCH kernel] panic: Dump registers on panic_on_warn
  2020-07-29  8:24 ` Alexey Kardashevskiy
@ 2020-07-29  8:35   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-07-29  8:35 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: linux-kernel, Nicholas Piggin

On Wed, Jul 29, 2020 at 06:24:26PM +1000, Alexey Kardashevskiy wrote:
> Ping?
> 
> 
> On 30/06/2020 19:38, Alexey Kardashevskiy wrote:
> > Currently we print stack and registers for ordinary warnings but
> > we do not for panic_on_warn which looks as oversight - panic()
> > will reboot the machine but won't print registers.
> > 
> > This moves printing of registers and modules earlier.
> > 
> > This does not move the stack dumping as panic() dumps it.
> > 
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> >  kernel/panic.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)

Why did you pick me and Nick as the people to get this patch?

Always use scripts/get_maintainer.pl please, that's what it is there
for...

thanks,

greg k-h

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

end of thread, other threads:[~2020-07-29  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-30  9:38 [PATCH kernel] panic: Dump registers on panic_on_warn Alexey Kardashevskiy
2020-07-29  8:24 ` Alexey Kardashevskiy
2020-07-29  8:35   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox