OSDN Git Service

Merge branches 'fixes', 'misc' and 'smp-hotplug' into for-next
[uclinux-h8/linux.git] / arch / arm / kernel / smp.c
index 12a6172..facd424 100644 (file)
  */
 struct secondary_data secondary_data;
 
-/*
- * control for which core is the next to come out of the secondary
- * boot "holding pen"
- */
-volatile int pen_release = -1;
-
 enum ipi_msg_type {
        IPI_WAKEUP,
        IPI_TIMER,
@@ -254,7 +248,7 @@ int __cpu_disable(void)
        /*
         * OK - migrate IRQs away from this CPU
         */
-       migrate_irqs();
+       irq_migrate_all_off_this_cpu();
 
        /*
         * Flush user cache and TLB mappings, and then remove this CPU
@@ -604,8 +598,10 @@ static void ipi_cpu_stop(unsigned int cpu)
        local_fiq_disable();
        local_irq_disable();
 
-       while (1)
+       while (1) {
                cpu_relax();
+               wfe();
+       }
 }
 
 static DEFINE_PER_CPU(struct completion *, cpu_completion);
@@ -724,6 +720,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
  */