2003-03-19 05:03:36

by Zwane Mwaikambo

[permalink] [raw]
Subject: [PATCH][2.5] Fail setup_irq for unconfigured IRQs

This patch makes us bail out in case we may have an interrupt which
couldn't be associated with an interrupt controller. Without this we allow
unconfigured interrupts to be assigned and then later on we get
"unexpected IRQ trap at vector xx" during the ack phase.

scenario:
This can occur if we fail irq setup during setup_IO_APIC_irqs for some
reason or other and then miss getting assigned a vector. Later on we then
get assigned no_irq_type as our handler.

Patch for i386 and x86_64

Index: linux-2.5.65-numaq/arch/i386/kernel/irq.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.65/arch/i386/kernel/irq.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 irq.c
--- linux-2.5.65-numaq/arch/i386/kernel/irq.c 17 Mar 2003 23:08:54 -0000 1.1.1.1
+++ linux-2.5.65-numaq/arch/i386/kernel/irq.c 19 Mar 2003 04:11:35 -0000
@@ -744,6 +744,8 @@ int setup_irq(unsigned int irq, struct i
struct irqaction *old, **p;
irq_desc_t *desc = irq_desc + irq;

+ if (desc->handler == &no_irq_type)
+ return -ENOSYS;
/*
* Some drivers like serial.c use request_irq() heavily,
* so we have to be careful not to interfere with a
Index: linux-2.5.65-numaq/arch/x86_64/kernel/irq.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.65/arch/x86_64/kernel/irq.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 irq.c
--- linux-2.5.65-numaq/arch/x86_64/kernel/irq.c 17 Mar 2003 23:09:50 -0000 1.1.1.1
+++ linux-2.5.65-numaq/arch/x86_64/kernel/irq.c 19 Mar 2003 04:46:11 -0000
@@ -732,6 +732,9 @@ int setup_irq(unsigned int irq, struct i
struct irqaction *old, **p;
irq_desc_t *desc = irq_desc + irq;

+ if (desc->handler == &no_irq_type)
+ return -ENOSYS;
+
/*
* Some drivers like serial.c use request_irq() heavily,
* so we have to be careful not to interfere with a

--
function.linuxpower.ca


2003-03-19 23:10:16

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH][2.5] Fail setup_irq for unconfigured IRQs

On Wed, 19 Mar 2003, Zwane Mwaikambo wrote:

> This patch makes us bail out in case we may have an interrupt which
> couldn't be associated with an interrupt controller. Without this we allow
> unconfigured interrupts to be assigned and then later on we get
> "unexpected IRQ trap at vector xx" during the ack phase.
>
> scenario:
> This can occur if we fail irq setup during setup_IO_APIC_irqs for some
> reason or other and then miss getting assigned a vector. Later on we then
> get assigned no_irq_type as our handler.

Here is a sample /proc/interrupts from an affected system...

41: 1313 796 1298 1380 IO-APIC-level qlogicisp
89: 0 0 0 0 none qlogicisp

Please apply,
Zwane