Commit af67c3a9 authored by Paul Mundt's avatar Paul Mundt

sh: update die() output.

This follows the ARM change, as SH had all of the same issues:

Make die() better match x86:
- add printing of the last accessed sysfs file
- ensure console_verbose() is called under the lock
- ensure we panic outside of oops_exit()
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 2caa7318
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/kexec.h> #include <linux/kexec.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/sysfs.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/fpu.h> #include <asm/fpu.h>
...@@ -159,12 +160,12 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -159,12 +160,12 @@ void die(const char * str, struct pt_regs * regs, long err)
oops_enter(); oops_enter();
console_verbose();
spin_lock_irq(&die_lock); spin_lock_irq(&die_lock);
console_verbose();
bust_spinlocks(1); bust_spinlocks(1);
printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
sysfs_printk_last_file();
print_modules(); print_modules();
show_regs(regs); show_regs(regs);
...@@ -180,6 +181,7 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -180,6 +181,7 @@ void die(const char * str, struct pt_regs * regs, long err)
bust_spinlocks(0); bust_spinlocks(0);
add_taint(TAINT_DIE); add_taint(TAINT_DIE);
spin_unlock_irq(&die_lock); spin_unlock_irq(&die_lock);
oops_exit();
if (kexec_should_crash(current)) if (kexec_should_crash(current))
crash_kexec(regs); crash_kexec(regs);
...@@ -190,7 +192,6 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -190,7 +192,6 @@ void die(const char * str, struct pt_regs * regs, long err)
if (panic_on_oops) if (panic_on_oops)
panic("Fatal exception"); panic("Fatal exception");
oops_exit();
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment