arm64: Move cpu_die_early to smp.c
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / kernel / smp.c
index a84623d91410d17daf444995c6c8ec1baceae939..ee247d441d38e691f397e15dcb94680c1793c608 100644 (file)
@@ -311,6 +311,28 @@ void cpu_die(void)
 }
 #endif
 
+/*
+ * Kill the calling secondary CPU, early in bringup before it is turned
+ * online.
+ */
+void cpu_die_early(void)
+{
+       int cpu = smp_processor_id();
+
+       pr_crit("CPU%d: will not boot\n", cpu);
+
+       /* Mark this CPU absent */
+       set_cpu_present(cpu, 0);
+
+#ifdef CONFIG_HOTPLUG_CPU
+       /* Check if we can park ourselves */
+       if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_die)
+               cpu_ops[cpu]->cpu_die(cpu);
+#endif
+
+       cpu_park_loop();
+}
+
 static void __init hyp_mode_check(void)
 {
        if (is_hyp_mode_available())