diff options
| author | Ingo Molnar <mingo@elte.hu> | 2006-06-29 05:24:52 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-29 13:26:24 -0400 |
| commit | dae8620421833bb2e9a01c4ccc42bdc3759b81df (patch) | |
| tree | a57ec739c39032d2c5bbb94951059706053cf484 | |
| parent | 6a6de9ef5850d063c3d3fb50784bfe3a6d0712c6 (diff) | |
[PATCH] genirq MSI fixes
This is a fixed up and cleaned up replacement for genirq-msi-fixes.patch,
which should solve the i386 4KSTACKS problem. I also added Ben's idea of
pushing the __do_IRQ() check into generic_handle_irq().
I booted this with MSI enabled, but i only have MSI devices, not MSI-X
devices. I'd still expect MSI-X to work now.
irqchip migration helper: call __do_IRQ() if a descriptor is attached to an
irqtype-style controller. This also fixes MSI-X IRQ handling on i386 and
x86_64.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | arch/i386/kernel/irq.c | 5 | ||||
| -rw-r--r-- | include/linux/irq.h | 27 |
2 files changed, 21 insertions, 11 deletions
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 3336cef9605a..16b491703967 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c | |||
| @@ -82,6 +82,10 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs) | |||
| 82 | } | 82 | } |
| 83 | #endif | 83 | #endif |
| 84 | 84 | ||
| 85 | if (!irq_desc[irq].handle_irq) { | ||
| 86 | __do_IRQ(irq, regs); | ||
| 87 | goto out_exit; | ||
| 88 | } | ||
| 85 | #ifdef CONFIG_4KSTACKS | 89 | #ifdef CONFIG_4KSTACKS |
| 86 | 90 | ||
| 87 | curctx = (union irq_ctx *) current_thread_info(); | 91 | curctx = (union irq_ctx *) current_thread_info(); |
| @@ -121,6 +125,7 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs) | |||
| 121 | #endif | 125 | #endif |
| 122 | __do_IRQ(irq, regs); | 126 | __do_IRQ(irq, regs); |
| 123 | 127 | ||
| 128 | out_exit: | ||
| 124 | irq_exit(); | 129 | irq_exit(); |
| 125 | 130 | ||
| 126 | return 1; | 131 | return 1; |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 437f2c635db6..b40771dd114a 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -176,17 +176,6 @@ typedef struct irq_desc irq_desc_t; | |||
| 176 | */ | 176 | */ |
| 177 | #include <asm/hw_irq.h> | 177 | #include <asm/hw_irq.h> |
| 178 | 178 | ||
| 179 | /* | ||
| 180 | * Architectures call this to let the generic IRQ layer | ||
| 181 | * handle an interrupt: | ||
| 182 | */ | ||
| 183 | static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs) | ||
| 184 | { | ||
| 185 | struct irq_desc *desc = irq_desc + irq; | ||
| 186 | |||
| 187 | desc->handle_irq(irq, desc, regs); | ||
| 188 | } | ||
| 189 | |||
| 190 | extern int setup_irq(unsigned int irq, struct irqaction *new); | 179 | extern int setup_irq(unsigned int irq, struct irqaction *new); |
| 191 | 180 | ||
| 192 | #ifdef CONFIG_GENERIC_HARDIRQS | 181 | #ifdef CONFIG_GENERIC_HARDIRQS |
| @@ -324,6 +313,22 @@ handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *, | |||
| 324 | */ | 313 | */ |
| 325 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); | 314 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); |
| 326 | 315 | ||
| 316 | /* | ||
| 317 | * Architectures call this to let the generic IRQ layer | ||
| 318 | * handle an interrupt. If the descriptor is attached to an | ||
| 319 | * irqchip-style controller then we call the ->handle_irq() handler, | ||
| 320 | * and it calls __do_IRQ() if it's attached to an irqtype-style controller. | ||
| 321 | */ | ||
| 322 | static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs) | ||
| 323 | { | ||
| 324 | struct irq_desc *desc = irq_desc + irq; | ||
| 325 | |||
| 326 | if (likely(desc->handle_irq)) | ||
| 327 | desc->handle_irq(irq, desc, regs); | ||
| 328 | else | ||
| 329 | __do_IRQ(irq, regs); | ||
| 330 | } | ||
| 331 | |||
| 327 | /* Handling of unhandled and spurious interrupts: */ | 332 | /* Handling of unhandled and spurious interrupts: */ |
| 328 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | 333 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, |
| 329 | int action_ret, struct pt_regs *regs); | 334 | int action_ret, struct pt_regs *regs); |
