CHROMIUM: config: Disable USB persist by default
[cascardo/linux.git] / kernel / panic.c
index 80aed44..be0b763 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/nmi.h>
 #include <linux/dmi.h>
+#include <linux/pm.h>
 
 #define PANIC_TIMER_STEP 100
 #define PANIC_BLINK_SPD 18
@@ -74,6 +75,14 @@ void panic(const char *fmt, ...)
        long i, i_next = 0;
        int state = 0;
 
+       /*
+        * Disable local interrupts. This will prevent panic_smp_self_stop
+        * from deadlocking the first cpu that invokes the panic, since
+        * there is nothing to prevent an interrupt handler (that runs
+        * after the panic_lock is acquired) from invoking panic again.
+        */
+       local_irq_disable();
+
        /*
         * It's possible to come here directly from a panic-assertion and
         * not have preempt disabled. Some functions called from here want
@@ -97,7 +106,7 @@ void panic(const char *fmt, ...)
        /*
         * Avoid nested stack-dumping if a panic occurs during oops processing
         */
-       if (!oops_in_progress)
+       if (!test_taint(TAINT_DIE) && oops_in_progress <= 1)
                dump_stack();
 #endif
 
@@ -359,7 +368,7 @@ void oops_enter(void)
 /*
  * 64-bit random ID for oopses:
  */
-static u64 oops_id;
+static u64 __suspend_volatile_bss oops_id;
 
 static int init_oops_id(void)
 {