]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Disable SW irqbalance/irqaffinity for E7520/E7320/E7525 - change TARGET_CPUS...
authorSuresh B. Siddha <suresh.b.siddha@intel.com>
Wed, 6 Oct 2004 01:14:47 +0000 (18:14 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 01:14:47 +0000 (18:14 -0700)
Set TARGET_CPUS on x86_64 to cpu_online_map.  This brings the code inline
with x86 mach-default.  Fix MSI_TARGET_CPU code which will break with this
target_cpus change.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/kernel/io_apic.c
arch/x86_64/kernel/smpboot.c
include/asm-x86_64/hw_irq.h
include/asm-x86_64/smp.h

index 1647afd7e514cb8e1f91b1e1de0d0a7256af9f40..aa087f6d9f1bd263ba1386662133cf61e4e7b147 100644 (file)
@@ -735,7 +735,7 @@ void __init setup_IO_APIC_irqs(void)
                entry.delivery_mode = dest_LowestPrio;
                entry.dest_mode = INT_DELIVERY_MODE;
                entry.mask = 0;                         /* enable IRQ */
-               entry.dest.logical.logical_dest = TARGET_CPUS;
+               entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
 
                idx = find_irq_entry(apic,pin,mp_INT);
                if (idx == -1) {
@@ -753,7 +753,7 @@ void __init setup_IO_APIC_irqs(void)
                if (irq_trigger(idx)) {
                        entry.trigger = 1;
                        entry.mask = 1;
-                       entry.dest.logical.logical_dest = TARGET_CPUS;
+                       entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
                }
 
                irq = pin_2_irq(idx, apic, pin);
@@ -803,7 +803,7 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector)
         */
        entry.dest_mode = INT_DELIVERY_MODE;
        entry.mask = 0;                                 /* unmask IRQ now */
-       entry.dest.logical.logical_dest = TARGET_CPUS;
+       entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
        entry.delivery_mode = dest_LowestPrio;
        entry.polarity = 0;
        entry.trigger = 0;
@@ -2011,7 +2011,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
        entry.delivery_mode = dest_LowestPrio;
        entry.dest_mode = INT_DELIVERY_MODE;
-       entry.dest.logical.logical_dest = TARGET_CPUS;
+       entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
        entry.trigger = edge_level;
        entry.polarity = active_high_low;
        entry.mask = 1;                                  /* Disabled (masked) */
@@ -2069,3 +2069,28 @@ void send_IPI_self(int vector)
        apic_write_around(APIC_ICR, cfg);
 }
 #endif
+
+
+/*
+ * This function currently is only a helper for the i386 smp boot process where
+ * we need to reprogram the ioredtbls to cater for the cpus which have come online
+ * so mask in all cases should simply be TARGET_CPUS
+ */
+void __init setup_ioapic_dest(void)
+{
+       int pin, ioapic, irq, irq_entry;
+
+       if (skip_ioapic_setup == 1)
+               return;
+
+       for (ioapic = 0; ioapic < nr_ioapics; ioapic++) {
+               for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) {
+                       irq_entry = find_irq_entry(ioapic, pin, mp_INT);
+                       if (irq_entry == -1)
+                               continue;
+                       irq = pin_2_irq(irq_entry, ioapic, pin);
+                       set_ioapic_affinity_irq(irq, TARGET_CPUS);
+               }
+
+       }
+}
index 28df08efe2bf7a92d0aa355b36343dbfc0aad707..dc0f40fea384290281fcac1277293d2bcb5fad04 100644 (file)
@@ -950,6 +950,9 @@ int __devinit __cpu_up(unsigned int cpu)
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
+#ifdef CONFIG_X86_IO_APIC
+       setup_ioapic_dest();
+#endif
        zap_low_mappings();
 }
 
index c77b473471b2d574b7ec54b2389b955cda67ed59..4a42816524a8ab04981bf38c1f68df46f2a407fb 100644 (file)
@@ -101,6 +101,7 @@ extern void disable_IO_APIC(void);
 extern void print_IO_APIC(void);
 extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
 extern void send_IPI(int dest, int vector);
+extern void setup_ioapic_dest(void);
 
 extern unsigned long io_apic_irqs;
 
index 7de368fce584ae76228d08e04897923a3c20bcf1..03841bec8fc895925420d13ae37ffe7a7976d4f8 100644 (file)
@@ -110,9 +110,13 @@ static inline int cpu_present_to_apicid(int mps_cpu)
 
 #endif
 #define INT_DELIVERY_MODE 1     /* logical delivery */
-#define TARGET_CPUS 1
 
 #ifndef ASSEMBLY
+#ifdef CONFIG_SMP
+#define TARGET_CPUS cpu_online_map
+#else
+#define TARGET_CPUS cpumask_of_cpu(0)
+#endif
 static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
        return cpus_addr(cpumask)[0];