]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/smpboot.c
x86: Restore proper vector locking during cpu hotplug
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / smpboot.c
index 332512767f4f0600d15ed473391528b20c4a5a72..da10f07fc59cbf2b95e96456f6355917694ece7c 100644 (file)
@@ -326,12 +326,16 @@ static void __cpuinit start_secondary(void *unused)
         * for which cpus receive the IPI. Holding this
         * lock helps us to not include this cpu in a currently in progress
         * smp_call_function().
+        *
+        * We need to hold vector_lock so there the set of online cpus
+        * does not change while we are assigning vectors to cpus.  Holding
+        * this lock ensures we don't half assign or remove an irq from a cpu.
         */
        ipi_call_lock_irq();
-#ifdef CONFIG_X86_IO_APIC
-       setup_vector_irq(smp_processor_id());
-#endif
+       lock_vector_lock();
+       __setup_vector_irq(smp_processor_id());
        cpu_set(smp_processor_id(), cpu_online_map);
+       unlock_vector_lock();
        ipi_call_unlock_irq();
        per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
 
@@ -1336,7 +1340,9 @@ int __cpu_disable(void)
        remove_siblinginfo(cpu);
 
        /* It's now safe to remove this processor from the online map */
+       lock_vector_lock();
        remove_cpu_from_maps(cpu);
+       unlock_vector_lock();
        fixup_irqs(cpu_online_map);
        return 0;
 }