[PATCH][2.5] Fail setup_irq for unconfigured IRQs

From: Zwane Mwaikambo (zwane@holomorphy.com)
Date: Wed Mar 19 2003 - 00:11:00 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:25 EST