Commit 55f26259 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fail setup_irq for unconfigured IRQs

From: Zwane Mwaikambo <zwane@holomorphy.com>

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
parent eb0e2cf6
...@@ -744,6 +744,8 @@ int setup_irq(unsigned int irq, struct irqaction * new) ...@@ -744,6 +744,8 @@ int setup_irq(unsigned int irq, struct irqaction * new)
struct irqaction *old, **p; struct irqaction *old, **p;
irq_desc_t *desc = irq_desc + irq; irq_desc_t *desc = irq_desc + irq;
if (desc->handler == &no_irq_type)
return -ENOSYS;
/* /*
* Some drivers like serial.c use request_irq() heavily, * Some drivers like serial.c use request_irq() heavily,
* so we have to be careful not to interfere with a * so we have to be careful not to interfere with a
......
...@@ -732,6 +732,9 @@ int setup_irq(unsigned int irq, struct irqaction * new) ...@@ -732,6 +732,9 @@ int setup_irq(unsigned int irq, struct irqaction * new)
struct irqaction *old, **p; struct irqaction *old, **p;
irq_desc_t *desc = irq_desc + irq; irq_desc_t *desc = irq_desc + irq;
if (desc->handler == &no_irq_type)
return -ENOSYS;
/* /*
* Some drivers like serial.c use request_irq() heavily, * Some drivers like serial.c use request_irq() heavily,
* so we have to be careful not to interfere with a * so we have to be careful not to interfere with a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment