mips/panic: replace smp_send_stop() with kdump friendly version in panic path
[cascardo/linux.git] / arch / mips / kernel / crash.c
index 610f0f3..1723b17 100644 (file)
@@ -47,9 +47,14 @@ static void crash_shutdown_secondary(void *passed_regs)
 
 static void crash_kexec_prepare_cpus(void)
 {
+       static int cpus_stopped;
        unsigned int msecs;
+       unsigned int ncpus;
 
-       unsigned int ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
+       if (cpus_stopped)
+               return;
+
+       ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
 
        dump_send_ipi(crash_shutdown_secondary);
        smp_wmb();
@@ -64,6 +69,17 @@ static void crash_kexec_prepare_cpus(void)
                cpu_relax();
                mdelay(1);
        }
+
+       cpus_stopped = 1;
+}
+
+/* Override the weak function in kernel/panic.c */
+void crash_smp_send_stop(void)
+{
+       if (_crash_smp_send_stop)
+               _crash_smp_send_stop();
+
+       crash_kexec_prepare_cpus();
 }
 
 #else /* !defined(CONFIG_SMP)  */