From: "Jan Beulich" Subject: [PATCH] x86: fix boot failure (regression from pre-4.0 IRQ handling changes) Date: Tue, 28 Sep 2010 09:38:05 +0100 Message-ID: <4CA1C58D0200007800019422@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part517CB17D.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: Markus Schuster List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part517CB17D.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 Tested-by: Markus Schuster --- a/xen/arch/x86/i8259.c +++ b/xen/arch/x86/i8259.c @@ -367,6 +367,12 @@ void __devinit init_8259A(int auto_eoi) spin_unlock_irqrestore(&i8259A_lock, flags); } =20 +void __init make_8259A_irq(unsigned int irq) +{ + io_apic_irqs &=3D ~(1 << irq); + irq_to_desc(irq)->handler =3D &i8259A_irq_type; +} + static struct irqaction __read_mostly cascade =3D { no_action, "cascade", = NULL}; =20 void __init init_IRQ(void) --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -38,9 +38,6 @@ #include #include =20 -/* Different to Linux: our implementation can be simpler. */ -#define make_8259A_irq(irq) (io_apic_irqs &=3D ~(1<<(irq))) - int (*ioapic_renumber_irq)(int ioapic, int irq); atomic_t irq_mis_count; =20 @@ -1929,7 +1926,6 @@ static inline void check_timer(void) =20 irq_desc[0].depth =3D 0; irq_desc[0].status &=3D ~IRQ_DISABLED; - irq_desc[0].handler =3D &ioapic_edge_type; =20 /* * Subtle, code in do_timer_interrupt() expects an AEOI --- a/xen/include/asm-x86/irq.h +++ b/xen/include/asm-x86/irq.h @@ -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); =20 --=__Part517CB17D.0__= Content-Type: text/plain; name="x86-timer-extint.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-timer-extint.patch" With the change to index irq_desc[] by IRQ rather than by vector, = the=0Aprior implicit change of the used flow handler when altering the = IRQ=0Arouting path to go through the 8259A didn't work anymore, and = hence=0Aon boards needing the ExtINT delivery workaround failed to = boot.=0A=0AMake make_8259A_irq() a real function again, thus allowing the = flow=0Ahandler to be changed there.=0A=0AAlso eliminate the generally = superfluous and (at least theoretically)=0Adangerous hard coded setting of = the flow handler for IRQ0: Earlier=0Acode should have set this already = based on information coming from=0AACPI/MPS, and non-standard systems may = e.g. have this IRQ level=0Atriggered.=0A=0ASigned-off-by: Jan Beulich = =0ATested-by: Markus Schuster =0A=0A--- a/xen/arch/x86/i8259.c=0A+++ b/xen/arch/x86/i8259.c=0A@@ -367,6 = +367,12 @@ void __devinit init_8259A(int auto_eoi)=0A spin_unlock_irqre= store(&i8259A_lock, flags);=0A }=0A =0A+void __init make_8259A_irq(unsigned= int irq)=0A+{=0A+ io_apic_irqs &=3D ~(1 << irq);=0A+ irq_to_desc(irq= )->handler =3D &i8259A_irq_type;=0A+}=0A+=0A static struct irqaction = __read_mostly cascade =3D { no_action, "cascade", NULL};=0A =0A void = __init init_IRQ(void)=0A--- a/xen/arch/x86/io_apic.c=0A+++ b/xen/arch/x86/i= o_apic.c=0A@@ -38,9 +38,6 @@=0A #include =0A #include = =0A =0A-/* Different to Linux: our implementation can be = simpler. */=0A-#define make_8259A_irq(irq) (io_apic_irqs &=3D ~(1<<(irq)))= =0A-=0A int (*ioapic_renumber_irq)(int ioapic, int irq);=0A atomic_t = irq_mis_count;=0A =0A@@ -1929,7 +1926,6 @@ static inline void check_timer(v= oid)=0A =0A irq_desc[0].depth =3D 0;=0A irq_desc[0].status = &=3D ~IRQ_DISABLED;=0A- irq_desc[0].handler =3D &ioapic_edge_type;=0A = =0A /*=0A * Subtle, code in do_timer_interrupt() expects an = AEOI=0A--- a/xen/include/asm-x86/irq.h=0A+++ b/xen/include/asm-x86/irq.h=0A= @@ -91,6 +91,7 @@ int i8259A_irq_pending(unsigned int irq)=0A void = mask_8259A(void);=0A void unmask_8259A(void);=0A void init_8259A(int = aeoi);=0A+void make_8259A_irq(unsigned int irq);=0A int i8259A_suspend(void= );=0A int i8259A_resume(void);=0A =0A --=__Part517CB17D.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part517CB17D.0__=--