diff options
author | Yury Polyanskiy <ypolyans@princeton.edu> | 2010-04-26 00:53:10 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-04-30 15:52:45 -0400 |
commit | ce384d83d00ee457c3931d3fdb9fa2c38e345a3c (patch) | |
tree | 9f2a8a21236f0a270118d393e893cdc4986d229b /arch/mips/kernel/traps.c | |
parent | fcf3ca4c3d6d911df8ee2b8f010ffe504d3aef71 (diff) |
MIPS: die() does not call die notifier chain
The MIPS implementation of die() forgets to call notify_die() and thus notifiers
registered via register_die_notifier() are not called. This results in kgdb not
being activated on exceptions.
The only subtlety is that notify_die declares its regs argument w/o const, so
the const had to be removed from mips die() as well.
[Ralf: Fixed build error for SGI IP22 and IP28 platforms.]
Signed-off-by: Yury Polyanskiy <ypolyans@princeton.edu>
Cc: linux-mips@linux-mips.org
Patchworks: http://patchwork.linux-mips.org/patch/1142/
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r-- | arch/mips/kernel/traps.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 1a4dd657ccb9..36460c7b7cc8 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -352,9 +352,10 @@ void show_registers(const struct pt_regs *regs) | |||
352 | 352 | ||
353 | static DEFINE_SPINLOCK(die_lock); | 353 | static DEFINE_SPINLOCK(die_lock); |
354 | 354 | ||
355 | void __noreturn die(const char * str, const struct pt_regs * regs) | 355 | void __noreturn die(const char * str, struct pt_regs * regs) |
356 | { | 356 | { |
357 | static int die_counter; | 357 | static int die_counter; |
358 | int sig = SIGSEGV; | ||
358 | #ifdef CONFIG_MIPS_MT_SMTC | 359 | #ifdef CONFIG_MIPS_MT_SMTC |
359 | unsigned long dvpret = dvpe(); | 360 | unsigned long dvpret = dvpe(); |
360 | #endif /* CONFIG_MIPS_MT_SMTC */ | 361 | #endif /* CONFIG_MIPS_MT_SMTC */ |
@@ -365,6 +366,10 @@ void __noreturn die(const char * str, const struct pt_regs * regs) | |||
365 | #ifdef CONFIG_MIPS_MT_SMTC | 366 | #ifdef CONFIG_MIPS_MT_SMTC |
366 | mips_mt_regdump(dvpret); | 367 | mips_mt_regdump(dvpret); |
367 | #endif /* CONFIG_MIPS_MT_SMTC */ | 368 | #endif /* CONFIG_MIPS_MT_SMTC */ |
369 | |||
370 | if (notify_die(DIE_OOPS, str, regs, 0, current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) | ||
371 | sig = 0; | ||
372 | |||
368 | printk("%s[#%d]:\n", str, ++die_counter); | 373 | printk("%s[#%d]:\n", str, ++die_counter); |
369 | show_registers(regs); | 374 | show_registers(regs); |
370 | add_taint(TAINT_DIE); | 375 | add_taint(TAINT_DIE); |
@@ -379,7 +384,7 @@ void __noreturn die(const char * str, const struct pt_regs * regs) | |||
379 | panic("Fatal exception"); | 384 | panic("Fatal exception"); |
380 | } | 385 | } |
381 | 386 | ||
382 | do_exit(SIGSEGV); | 387 | do_exit(sig); |
383 | } | 388 | } |
384 | 389 | ||
385 | extern struct exception_table_entry __start___dbe_table[]; | 390 | extern struct exception_table_entry __start___dbe_table[]; |