linux-mips
[Top] [All Lists]

[PATCH] Honour "panic_on_oops" sysctl on mips arch

To: linux-mips@linux-mips.org
Subject: [PATCH] Honour "panic_on_oops" sysctl on mips arch
From: Maxime Bizon <mbizon@freebox.fr>
Date: Thu, 20 Jul 2006 18:52:02 +0200
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: mbizon@freebox.fr
Sender: linux-mips-bounce@linux-mips.org
Hello all,

The panic_on_oops sysctl has no effect on mips, the following patch
fixes it.


Signed-off-by: Maxime Bizon <mbizon@freebox.fr>

--- linux-2.6.17.6/arch/mips/kernel/traps.c.orig        2006-07-20 
18:42:37.000000000 +0200
+++ linux-2.6.17.6/arch/mips/kernel/traps.c     2006-07-20 18:42:56.000000000 
+0200
@@ -21,6 +21,7 @@
 #include <linux/spinlock.h>
 #include <linux/kallsyms.h>
 #include <linux/bootmem.h>
+#include <linux/interrupt.h>
 
 #include <asm/bootinfo.h>
 #include <asm/branch.h>
@@ -293,6 +294,16 @@
        printk("%s[#%d]:\n", str, ++die_counter);
        show_registers(regs);
        spin_unlock_irq(&die_lock);
+
+       if (in_interrupt())
+               panic("Fatal exception in interrupt");
+
+       if (panic_on_oops) {
+               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
+               ssleep(5);
+               panic("Fatal exception");
+       }
+
        do_exit(SIGSEGV);
 }
 


Regards,

-- 
Maxime

<Prev in Thread] Current Thread [Next in Thread>