]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/kernel/apic/io_apic.c
x86, irq: Move __setup_vector_irq() before the first irq enable in cpu online path
[net-next-2.6.git] / arch / x86 / kernel / apic / io_apic.c
index 2430b31c9857ae43d971f9f7de2def584905d08b..937150e4c06dc27e5fc8583a71d2a81719bd8efa 100644 (file)
@@ -1256,11 +1256,16 @@ static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
 void __setup_vector_irq(int cpu)
 {
        /* Initialize vector_irq on a new cpu */
-       /* This function must be called with vector_lock held */
        int irq, vector;
        struct irq_cfg *cfg;
        struct irq_desc *desc;
 
+       /*
+        * vector_lock will make sure that we don't run into irq vector
+        * assignments that might be happening on another cpu in parallel,
+        * while we setup our initial vector to irq mappings.
+        */
+       spin_lock(&vector_lock);
        /* Mark the inuse vectors */
        for_each_irq_desc(irq, desc) {
                cfg = desc->chip_data;
@@ -1279,6 +1284,7 @@ void __setup_vector_irq(int cpu)
                if (!cpumask_test_cpu(cpu, cfg->domain))
                        per_cpu(vector_irq, cpu)[vector] = -1;
        }
+       spin_unlock(&vector_lock);
 }
 
 static struct irq_chip ioapic_chip;