panic: dump registers on panic_on_warn

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 <>
Signed-off-by: Andrew Morton <>
Reviewed-by: Kees Cook <>
Cc: Douglas Anderson <>
Cc: Ingo Molnar <>
Cc: Kees Cook <>
Cc: Rafael Aquini <>
Cc: Thomas Gleixner <>
Cc: Will Deacon <>
Cc: Nicholas Piggin <>
Signed-off-by: Linus Torvalds <>
1 file changed