]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/io_apic_32.c
Driver core: change sysdev classes to use dynamic kobject names
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / io_apic_32.c
index e2f4a1c685476c0025e88007c674e939ae19574d..ab77f1905469592b724ce9c6bdd7c3ea70f0e408 100644 (file)
@@ -378,7 +378,7 @@ static struct irq_cpu_info {
 
 #define IRQ_ALLOWED(cpu, allowed_mask) cpu_isset(cpu, allowed_mask)
 
-#define CPU_TO_PACKAGEINDEX(i) (first_cpu(cpu_sibling_map[i]))
+#define CPU_TO_PACKAGEINDEX(i) (first_cpu(per_cpu(cpu_sibling_map, i)))
 
 static cpumask_t balance_irq_affinity[NR_IRQS] = {
        [0 ... NR_IRQS-1] = CPU_MASK_ALL
@@ -584,7 +584,7 @@ tryanotherirq:
 
        imbalance = move_this_load;
        
-       /* For physical_balance case, we accumlated both load
+       /* For physical_balance case, we accumulated both load
         * values in the one of the siblings cpu_irq[],
         * to use the same code for physical and logical processors
         * as much as possible. 
@@ -598,7 +598,7 @@ tryanotherirq:
         * (A+B)/2 vs B
         */
        load = CPU_IRQ(min_loaded) >> 1;
-       for_each_cpu_mask(j, cpu_sibling_map[min_loaded]) {
+       for_each_cpu_mask(j, per_cpu(cpu_sibling_map, min_loaded)) {
                if (load > CPU_IRQ(j)) {
                        /* This won't change cpu_sibling_map[min_loaded] */
                        load = CPU_IRQ(j);
@@ -962,7 +962,7 @@ static int EISA_ELCR(unsigned int irq)
 #define default_MCA_trigger(idx)       (1)
 #define default_MCA_polarity(idx)      (0)
 
-static int __init MPBIOS_polarity(int idx)
+static int MPBIOS_polarity(int idx)
 {
        int bus = mp_irqs[idx].mpc_srcbus;
        int polarity;
@@ -1198,7 +1198,7 @@ static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 }
 static int __assign_irq_vector(int irq)
 {
        static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
-       int vector, offset, i;
+       int vector, offset;
 
        BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
 
@@ -1215,11 +1215,8 @@ next:
        }
        if (vector == current_vector)
                return -ENOSPC;
-       if (vector == SYSCALL_VECTOR)
+       if (test_and_set_bit(vector, used_vectors))
                goto next;
-       for (i = 0; i < NR_IRQ_VECTORS; i++)
-               if (irq_vector[i] == vector)
-                       goto next;
 
        current_vector = vector;
        current_offset = offset;
@@ -1296,6 +1293,11 @@ static void __init setup_IO_APIC_irqs(void)
                        continue;
                }
 
+               if (!first_notcon) {
+                       apic_printk(APIC_VERBOSE, " not connected.\n");
+                       first_notcon = 1;
+               }
+
                entry.trigger = irq_trigger(idx);
                entry.polarity = irq_polarity(idx);
 
@@ -1880,13 +1882,16 @@ __setup("no_timer_check", notimercheck);
 static int __init timer_irq_works(void)
 {
        unsigned long t1 = jiffies;
+       unsigned long flags;
 
        if (no_timer_check)
                return 1;
 
+       local_save_flags(flags);
        local_irq_enable();
        /* Let ten ticks pass... */
        mdelay((10 * 1000) / HZ);
+       local_irq_restore(flags);
 
        /*
         * Expect a few ticks at least, to be sure some possible
@@ -2164,6 +2169,9 @@ static inline void __init check_timer(void)
 {
        int apic1, pin1, apic2, pin2;
        int vector;
+       unsigned long flags;
+
+       local_irq_save(flags);
 
        /*
         * get/set the timer IRQ vector:
@@ -2209,7 +2217,7 @@ static inline void __init check_timer(void)
                        }
                        if (disable_timer_pin_1 > 0)
                                clear_IO_APIC_pin(0, pin1);
-                       return;
+                       goto out;
                }
                clear_IO_APIC_pin(apic1, pin1);
                printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
@@ -2232,7 +2240,7 @@ static inline void __init check_timer(void)
                        if (nmi_watchdog == NMI_IO_APIC) {
                                setup_nmi();
                        }
-                       return;
+                       goto out;
                }
                /*
                 * Cleanup, just in case ...
@@ -2256,7 +2264,7 @@ static inline void __init check_timer(void)
 
        if (timer_irq_works()) {
                printk(" works.\n");
-               return;
+               goto out;
        }
        apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
        printk(" failed.\n");
@@ -2272,11 +2280,13 @@ static inline void __init check_timer(void)
 
        if (timer_irq_works()) {
                printk(" works.\n");
-               return;
+               goto out;
        }
        printk(" failed :(.\n");
        panic("IO-APIC + timer doesn't work!  Boot with apic=debug and send a "
                "report.  Then try booting with the 'noapic' option");
+out:
+       local_irq_restore(flags);
 }
 
 /*
@@ -2290,6 +2300,12 @@ static inline void __init check_timer(void)
 
 void __init setup_IO_APIC(void)
 {
+       int i;
+
+       /* Reserve all the system vectors. */
+       for (i = FIRST_SYSTEM_VECTOR; i < NR_VECTORS; i++)
+               set_bit(i, used_vectors);
+
        enable_IO_APIC();
 
        if (acpi_ioapic)
@@ -2385,7 +2401,7 @@ static int ioapic_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class ioapic_sysdev_class = {
-       set_kset_name("ioapic"),
+       .name = "ioapic",
        .suspend = ioapic_suspend,
        .resume = ioapic_resume,
 };
@@ -2467,7 +2483,7 @@ void destroy_irq(unsigned int irq)
 }
 
 /*
- * MSI mesage composition
+ * MSI message composition
  */
 #ifdef CONFIG_PCI_MSI
 static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg)
@@ -2822,6 +2838,25 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
        return 0;
 }
 
+int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
+{
+       int i;
+
+       if (skip_ioapic_setup)
+               return -1;
+
+       for (i = 0; i < mp_irq_entries; i++)
+               if (mp_irqs[i].mpc_irqtype == mp_INT &&
+                   mp_irqs[i].mpc_srcbusirq == bus_irq)
+                       break;
+       if (i >= mp_irq_entries)
+               return -1;
+
+       *trigger = irq_trigger(i);
+       *polarity = irq_polarity(i);
+       return 0;
+}
+
 #endif /* CONFIG_ACPI */
 
 static int __init parse_disable_timer_pin_1(char *arg)