]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - arch/arm/kernel/smp.c
ARM: 8808/1: kexec:offline panic_smp_self_stop CPU
[mirror_ubuntu-hirsute-kernel.git] / arch / arm / kernel / smp.c
index 0978282d5fc27a7c4a5e6b0e274da8bfc4c14c8d..f574a5e0d589fa6a43c082ac8d532495f50bb0a6 100644 (file)
@@ -693,6 +693,21 @@ void smp_send_stop(void)
                pr_warn("SMP: failed to stop secondary CPUs\n");
 }
 
+/* In case panic() and panic() called at the same time on CPU1 and CPU2,
+ * and CPU 1 calls panic_smp_self_stop() before crash_smp_send_stop()
+ * CPU1 can't receive the ipi irqs from CPU2, CPU1 will be always online,
+ * kdump fails. So split out the panic_smp_self_stop() and add
+ * set_cpu_online(smp_processor_id(), false).
+ */
+void panic_smp_self_stop(void)
+{
+       pr_debug("CPU %u will stop doing anything useful since another CPU has paniced\n",
+                smp_processor_id());
+       set_cpu_online(smp_processor_id(), false);
+       while (1)
+               cpu_relax();
+}
+
 /*
  * not supported here
  */