linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.5] Fail setup_irq for unconfigured IRQs
@ 2003-03-19  5:11 Zwane Mwaikambo
  2003-03-19 23:17 ` Zwane Mwaikambo
  0 siblings, 1 reply; 2+ messages in thread
From: Zwane Mwaikambo @ 2003-03-19  5:11 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Ingo Molnar, Andi Kleen

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][2.5] Fail setup_irq for unconfigured IRQs
  2003-03-19  5:11 [PATCH][2.5] Fail setup_irq for unconfigured IRQs Zwane Mwaikambo
@ 2003-03-19 23:17 ` Zwane Mwaikambo
  0 siblings, 0 replies; 2+ messages in thread
From: Zwane Mwaikambo @ 2003-03-19 23:17 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Ingo Molnar, Andi Kleen

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-19 23:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-19  5:11 [PATCH][2.5] Fail setup_irq for unconfigured IRQs Zwane Mwaikambo
2003-03-19 23:17 ` Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).