public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* genirq handle helper
@ 2006-05-31  3:38 Benjamin Herrenschmidt
  2006-05-31  5:49 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2006-05-31  3:38 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner; +Cc: Linux Kernel list

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.

Index: linux-work/include/linux/irq.h
===================================================================
--- linux-work.orig/include/linux/irq.h	2006-05-31 11:26:45.000000000 +1000
+++ linux-work/include/linux/irq.h	2006-05-31 13:31:11.000000000 +1000
@@ -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);



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

* Re: genirq handle helper
  2006-05-31  3:38 genirq handle helper Benjamin Herrenschmidt
@ 2006-05-31  5:49 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2006-05-31  5:49 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Thomas Gleixner, Linux Kernel list, Andrew Morton


* Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> 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.

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

Acked-by: Ingo Molnar <mingo@elte.hu>

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

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

end of thread, other threads:[~2006-05-31  5:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-31  3:38 genirq handle helper Benjamin Herrenschmidt
2006-05-31  5:49 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox