]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/arm64/kernel/smp.c
arm64: smp: fix crash_smp_send_stop() behaviour
[linux.git] / arch / arm64 / kernel / smp.c
index e4dc241c5a8e8e4af45d5c3bcefbbfc83255a167..5407bf5d98ac5ec4a0a19be90bb638525b0d2325 100644 (file)
@@ -1012,7 +1012,11 @@ void crash_smp_send_stop(void)
 
        cpus_stopped = 1;
 
-       if (num_online_cpus() == 1) {
+       /*
+        * If this cpu is the only one alive at this point in time, online or
+        * not, there are no stop messages to be sent around, so just back out.
+        */
+       if (num_other_online_cpus() == 0) {
                sdei_mask_local_cpu();
                return;
        }
@@ -1020,7 +1024,7 @@ void crash_smp_send_stop(void)
        cpumask_copy(&mask, cpu_online_mask);
        cpumask_clear_cpu(smp_processor_id(), &mask);
 
-       atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
+       atomic_set(&waiting_for_crash_ipi, num_other_online_cpus());
 
        pr_crit("SMP: stopping secondary CPUs\n");
        smp_cross_call(&mask, IPI_CPU_CRASH_STOP);