Skip to contentSkip to conversation

genirq handle helper

PATCH Benjamin Herrenschmidt 2 participants 2 messages May 31, 2006 IRQ

lore
Share & tools
lore
#0 lore raw

Hi Ingo, Thomas !

This simple pach makes the transition easier. By making generic_handle_irq() call the old __do_IRQ if no new-style handler exist for a given irq, the transition from old style to new style is made easier for me. That is, I can have some PICs use the new handler mecanism while old ones still get __do_IRQ without having the common powerpc code caring about the type of PIC (it just does generic_handle_irq()).

Might be useful to others as well, at least until everybody is ported over.

Cheers,
Ben.

include/linux/irq.h +14 -11
Index: linux-work/include/linux/irq.h
===================================================================
@@ -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
@@ -316,6 +305,20 @@ handle_irq_name(void fastcall (*handle)(
  */
 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:
+ */
+static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
+{
+	struct irq_desc *desc = irq_desc + irq;
+
+	if (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);
Acked-by
#1 lore raw
Quoted 10 lines · Benjamin Herrenschmidt

Hi Ingo, Thomas !

This simple pach makes the transition easier. By making generic_handle_irq() call the old __do_IRQ if no new-style handler exist for a given irq, the transition from old style to new style is made easier for me. That is, I can have some PICs use the new handler mecanism while old ones still get __do_IRQ without having the common powerpc code caring about the type of PIC (it just does generic_handle_irq()).

Quoted 2 lines

Might be useful to others as well, at least until everybody is ported over.

yeah, good idea - this will also make the MSI fix simpler.

Andrew, if you add Ben's patch, you can drop the arch/x86_64/kernel/irq.c bits of genirq-msi-fixes.patch. [if they stay they wont hurt, they'll only be redundant.]

Ingo