Skip to content

Commit

Permalink
[PATCH] genirq MSI fixes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jun 29, 2006
1 parent 6a6de9e commit dae8620
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
5 changes: 5 additions & 0 deletions arch/i386/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs)
}
#endif

if (!irq_desc[irq].handle_irq) {
__do_IRQ(irq, regs);
goto out_exit;
}
#ifdef CONFIG_4KSTACKS

curctx = (union irq_ctx *) current_thread_info();
Expand Down Expand Up @@ -121,6 +125,7 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs)
#endif
__do_IRQ(irq, regs);

out_exit:
irq_exit();

return 1;
Expand Down
27 changes: 16 additions & 11 deletions include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,6 @@ typedef struct irq_desc irq_desc_t;
*/
#include <asm/hw_irq.h>

/*
* Architectures call this to let the generic IRQ layer
* handle an interrupt:
*/
static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
{
struct irq_desc *desc = irq_desc + irq;

desc->handle_irq(irq, desc, regs);
}

extern int setup_irq(unsigned int irq, struct irqaction *new);

#ifdef CONFIG_GENERIC_HARDIRQS
Expand Down Expand Up @@ -324,6 +313,22 @@ handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
*/
extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);

/*
* Architectures call this to let the generic IRQ layer
* handle an interrupt. If the descriptor is attached to an
* irqchip-style controller then we call the ->handle_irq() handler,
* and it calls __do_IRQ() if it's attached to an irqtype-style controller.
*/
static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
{
struct irq_desc *desc = irq_desc + irq;

if (likely(desc->handle_irq))
desc->handle_irq(irq, desc, regs);
else
__do_IRQ(irq, regs);
}

/* Handling of unhandled and spurious interrupts: */
extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
int action_ret, struct pt_regs *regs);
Expand Down

0 comments on commit dae8620

Please sign in to comment.