Merge tag 'asm-generic-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd...
[deliverable/linux.git] / arch / mips / kernel / crash.c
index d434d5d5ae6e70b5241fe2fae2f3d1a0ec8bb1ed..610f0f3bdb3455cfa42629e98f8cc883524fe8ba 100644 (file)
@@ -14,12 +14,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;
This page took 0.024186 seconds and 5 git commands to generate.