]> git.neil.brown.name Git - history.git/commitdiff
[ACPI] Move the "only do this once" stuff from acpi_register_gsi() into
authorLen Brown <len.brown@intel.com>
Mon, 25 Oct 2004 19:30:02 +0000 (15:30 -0400)
committerLen Brown <lenb@dhcppc3.>
Mon, 25 Oct 2004 19:30:02 +0000 (15:30 -0400)
eisa_set_level().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
arch/i386/kernel/acpi/boot.c
arch/i386/pci/irq.c

index 8a0536250dd3313505c2ef0a0d4d11b767eafa28..f72f1bb6ac9d29cbed5f49bc3c84689e655da192 100644 (file)
@@ -456,16 +456,10 @@ unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
         * Make sure all (legacy) PCI IRQs are set as level-triggered.
         */
        if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
-               static u16 irq_mask;
                extern void eisa_set_level_irq(unsigned int irq);
 
-               if (edge_level == ACPI_LEVEL_SENSITIVE) {
-                       if ((gsi < 16) && !((1 << gsi) & irq_mask)) {
-                               Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi);
-                               irq_mask |= (1 << gsi);
+               if (edge_level == ACPI_LEVEL_SENSITIVE)
                                eisa_set_level_irq(gsi);
-                       }
-               }
        }
 #endif
 
index 6aa9e5fcfd76615b81dda6b051840e1bdebac644..5fc8dc3975542f7c7a092cca989b35d6b3efe488 100644 (file)
@@ -127,8 +127,15 @@ void eisa_set_level_irq(unsigned int irq)
 {
        unsigned char mask = 1 << (irq & 7);
        unsigned int port = 0x4d0 + (irq >> 3);
-       unsigned char val = inb(port);
+       unsigned char val;
+       static u16 eisa_irq_mask;
 
+       if (irq >= 16 || (1 << irq) & eisa_irq_mask)
+               return;
+
+       eisa_irq_mask |= (1 << irq);
+       printk("PCI: setting IRQ %u as level-triggered\n", irq);
+       val = inb(port);
        if (!(val & mask)) {
                DBG(" -> edge");
                outb(val | mask, port);