]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/io_apic.c
Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / io_apic.c
index 1fec0f9b1508cdc22f2cce5cfef9364cf4022b4f..9043251210fba4dc32ea7db009a1db6196216453 100644 (file)
@@ -3755,7 +3755,9 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
 void __init setup_ioapic_dest(void)
 {
        int pin, ioapic, irq, irq_entry;
+       struct irq_desc *desc;
        struct irq_cfg *cfg;
+       cpumask_t mask;
 
        if (skip_ioapic_setup == 1)
                return;
@@ -3772,16 +3774,30 @@ void __init setup_ioapic_dest(void)
                         * cpu is online.
                         */
                        cfg = irq_cfg(irq);
-                       if (!cfg->vector)
+                       if (!cfg->vector) {
                                setup_IO_APIC_irq(ioapic, pin, irq,
                                                  irq_trigger(irq_entry),
                                                  irq_polarity(irq_entry));
+                               continue;
+
+                       }
+
+                       /*
+                        * Honour affinities which have been set in early boot
+                        */
+                       desc = irq_to_desc(irq);
+                       if (desc->status &
+                           (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
+                               mask = desc->affinity;
+                       else
+                               mask = TARGET_CPUS;
+
 #ifdef CONFIG_INTR_REMAP
-                       else if (intr_remapping_enabled)
-                               set_ir_ioapic_affinity_irq(irq, TARGET_CPUS);
-#endif
+                       if (intr_remapping_enabled)
+                               set_ir_ioapic_affinity_irq(irq, mask);
                        else
-                               set_ioapic_affinity_irq(irq, TARGET_CPUS);
+#endif
+                               set_ioapic_affinity_irq(irq, mask);
                }
 
        }