x86: fix boot failure (regression from pre-4.0 IRQ handling changes)
authorKeir Fraser <keir@xen.org>
Sat, 2 Oct 2010 14:03:15 +0000 (15:03 +0100)
committerKeir Fraser <keir@xen.org>
Sat, 2 Oct 2010 14:03:15 +0000 (15:03 +0100)
With the change to index irq_desc[] by IRQ rather than by vector, the
prior implicit change of the used flow handler when altering the IRQ
routing path to go through the 8259A didn't work anymore, and hence
on boards needing the ExtINT delivery workaround failed to boot.

Make make_8259A_irq() a real function again, thus allowing the flow
handler to be changed there.

Also eliminate the generally superfluous and (at least theoretically)
dangerous hard coded setting of the flow handler for IRQ0: Earlier
code should have set this already based on information coming from
ACPI/MPS, and non-standard systems may e.g. have this IRQ level
triggered.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Tested-by: Markus Schuster <ml@markus.schuster.name>
xen/arch/x86/i8259.c
xen/arch/x86/io_apic.c
xen/include/asm-x86/irq.h

index 75e47ece60936aba934e6aca677b7d5e4527003f..7e4722c627a5a408e5282a7c447d9e347bd10cb3 100644 (file)
@@ -367,6 +367,12 @@ void __devinit init_8259A(int auto_eoi)
     spin_unlock_irqrestore(&i8259A_lock, flags);
 }
 
+void __init make_8259A_irq(unsigned int irq)
+{
+    io_apic_irqs &= ~(1 << irq);
+    irq_to_desc(irq)->handler = &i8259A_irq_type;
+}
+
 static struct irqaction __read_mostly cascade = { no_action, "cascade", NULL};
 
 void __init init_IRQ(void)
index 3b15c13e1f5206167faf65e37570d082de146d2a..3097fac3ffacee7426542ea25510e736869f3795 100644 (file)
@@ -38,9 +38,6 @@
 #include <io_ports.h>
 #include <public/physdev.h>
 
-/* Different to Linux: our implementation can be simpler. */
-#define make_8259A_irq(irq) (io_apic_irqs &= ~(1<<(irq)))
-
 int (*ioapic_renumber_irq)(int ioapic, int irq);
 atomic_t irq_mis_count;
 
@@ -1929,7 +1926,6 @@ static inline void check_timer(void)
     
     irq_desc[0].depth  = 0;
     irq_desc[0].status &= ~IRQ_DISABLED;
-    irq_desc[0].handler = &ioapic_edge_type;
 
     /*
      * Subtle, code in do_timer_interrupt() expects an AEOI
index 2e80dc948ac0b06e8a6071fb6fca3a04ca4bb65e..eb069ffce1ec23a040a9e53fd73396f8342fffd6 100644 (file)
@@ -91,6 +91,7 @@ int i8259A_irq_pending(unsigned int irq);
 void mask_8259A(void);
 void unmask_8259A(void);
 void init_8259A(int aeoi);
+void make_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
 int i8259A_resume(void);