diff options
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r-- | arch/mips/kernel/traps.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index b7517e3abc85..cbea618af0b4 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/bug.h> | 14 | #include <linux/bug.h> |
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/kernel.h> | ||
17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
19 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
@@ -364,21 +365,26 @@ static int regs_to_trapnr(struct pt_regs *regs) | |||
364 | return (regs->cp0_cause >> 2) & 0x1f; | 365 | return (regs->cp0_cause >> 2) & 0x1f; |
365 | } | 366 | } |
366 | 367 | ||
367 | static DEFINE_SPINLOCK(die_lock); | 368 | static DEFINE_RAW_SPINLOCK(die_lock); |
368 | 369 | ||
369 | void __noreturn die(const char *str, struct pt_regs *regs) | 370 | void __noreturn die(const char *str, struct pt_regs *regs) |
370 | { | 371 | { |
371 | static int die_counter; | 372 | static int die_counter; |
372 | int sig = SIGSEGV; | 373 | int sig = SIGSEGV; |
373 | #ifdef CONFIG_MIPS_MT_SMTC | 374 | #ifdef CONFIG_MIPS_MT_SMTC |
374 | unsigned long dvpret = dvpe(); | 375 | unsigned long dvpret; |
375 | #endif /* CONFIG_MIPS_MT_SMTC */ | 376 | #endif /* CONFIG_MIPS_MT_SMTC */ |
376 | 377 | ||
378 | oops_enter(); | ||
379 | |||
377 | if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) == NOTIFY_STOP) | 380 | if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) == NOTIFY_STOP) |
378 | sig = 0; | 381 | sig = 0; |
379 | 382 | ||
380 | console_verbose(); | 383 | console_verbose(); |
381 | spin_lock_irq(&die_lock); | 384 | raw_spin_lock_irq(&die_lock); |
385 | #ifdef CONFIG_MIPS_MT_SMTC | ||
386 | dvpret = dvpe(); | ||
387 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
382 | bust_spinlocks(1); | 388 | bust_spinlocks(1); |
383 | #ifdef CONFIG_MIPS_MT_SMTC | 389 | #ifdef CONFIG_MIPS_MT_SMTC |
384 | mips_mt_regdump(dvpret); | 390 | mips_mt_regdump(dvpret); |
@@ -387,7 +393,9 @@ void __noreturn die(const char *str, struct pt_regs *regs) | |||
387 | printk("%s[#%d]:\n", str, ++die_counter); | 393 | printk("%s[#%d]:\n", str, ++die_counter); |
388 | show_registers(regs); | 394 | show_registers(regs); |
389 | add_taint(TAINT_DIE); | 395 | add_taint(TAINT_DIE); |
390 | spin_unlock_irq(&die_lock); | 396 | raw_spin_unlock_irq(&die_lock); |
397 | |||
398 | oops_exit(); | ||
391 | 399 | ||
392 | if (in_interrupt()) | 400 | if (in_interrupt()) |
393 | panic("Fatal exception in interrupt"); | 401 | panic("Fatal exception in interrupt"); |