Merge tag 'v3.10.107' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / mips / kernel / crash.c
index 93aa302948d7236d70dc9f0b5ae9e96b7b123c8b..c68312947ed904041d1d7dd0414e33bcc8367da0 100644 (file)
@@ -15,12 +15,22 @@ static int crashing_cpu = -1;
 static cpumask_t cpus_in_crash = CPU_MASK_NONE;
 
 #ifdef CONFIG_SMP
-static void crash_shutdown_secondary(void *ignore)
+static void crash_shutdown_secondary(void *passed_regs)
 {
-       struct pt_regs *regs;
+       struct pt_regs *regs = passed_regs;
        int cpu = smp_processor_id();
 
-       regs = task_pt_regs(current);
+       /*
+        * If we are passed registers, use those.  Otherwise get the
+        * regs from the last interrupt, which should be correct, as
+        * we are in an interrupt.  But if the regs are not there,
+        * pull them from the top of the stack.  They are probably
+        * wrong, but we need something to keep from crashing again.
+        */
+       if (!regs)
+               regs = get_irq_regs();
+       if (!regs)
+               regs = task_pt_regs(current);
 
        if (!cpu_online(cpu))
                return;