*/
iommu_crash_shutdown();
- __stop_this_cpu();
+ if ( num_online_cpus() > 1 )
+ {
+ __stop_this_cpu();
- /* This is a bit of a hack due to the problems with the x2apic_enabled
- * variable, but we can't do any better without a significant refactoring
- * of the APIC code */
- x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC);
+ /*
+ * This is a bit of a hack due to the problems with the x2apic_enabled
+ * variable, but we can't do any better without a significant
+ * refactoring of the APIC code
+ */
+ x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC);
- disable_IO_APIC();
- hpet_disable();
+ disable_IO_APIC();
+ hpet_disable();
+ }
}
void machine_crash_shutdown(void)
*/
void smp_send_stop(void)
{
- int timeout = 10;
+ unsigned int cpu = smp_processor_id();
- local_irq_disable();
- fixup_irqs(cpumask_of(smp_processor_id()), 0);
- local_irq_enable();
+ if ( num_online_cpus() > 1 )
+ {
+ int timeout = 10;
- smp_call_function(stop_this_cpu, NULL, 0);
+ local_irq_disable();
+ fixup_irqs(cpumask_of(cpu), 0);
+ local_irq_enable();
- /* Wait 10ms for all other CPUs to go offline. */
- while ( (num_online_cpus() > 1) && (timeout-- > 0) )
- mdelay(1);
+ smp_call_function(stop_this_cpu, NULL, 0);
- local_irq_disable();
- disable_IO_APIC();
- hpet_disable();
- __stop_this_cpu();
- local_irq_enable();
+ /* Wait 10ms for all other CPUs to go offline. */
+ while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+ mdelay(1);
+ }
+
+ if ( cpu_online(cpu) )
+ {
+ local_irq_disable();
+ disable_IO_APIC();
+ hpet_disable();
+ __stop_this_cpu();
+ local_irq_enable();
+ }
}
void smp_send_nmi_allbutself(void)