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

Hi Thomas, Ingo !

There is one bit in genirq that I don't get (and doesn't work for me),
it's the "fastack" handler. It does:

out:
	if (!(desc->status & IRQ_DISABLED))
		desc->chip->ack(irq);
	else
		desc->chip->mask(irq);

Which doesn't at all match the needs of things like XICS or MPIC and
thus I wonder if it does also make sense for controllers for which you
intend it. It should just be:

	desc->chip->end(irq);

Basically, those controllers will have 1) already acke'd the interrupt
by the time you get the vector (the act of getting the vector does the
ack), 2) will use a processor priority mecanism to handle non-reentrency
of an interrupt thus mask/unmask is completely orthogonal to handling of
interrupts and thus there is no need to do anything about mask/unmask in
the handler, 3) all we need is to do an "EOI" (end of interrupt) at the
end of the handling, which is what is done logically in the end()
handler.

Thus this proposed patch:

Index: linux-work/kernel/irq/chip.c
===================================================================
--- linux-work.orig/kernel/irq/chip.c	2006-05-31 11:26:45.000000000 +1000
+++ linux-work/kernel/irq/chip.c	2006-05-31 11:48:19.000000000 +1000
@@ -325,10 +325,7 @@ handle_fastack_irq(unsigned int irq, str
 	spin_lock(&desc->lock);
 	desc->status &= ~IRQ_INPROGRESS;
 out:
-	if (!(desc->status & IRQ_DISABLED))
-		desc->chip->ack(irq);
-	else
-		desc->chip->mask(irq);
+	desc->chip->end(irq);
 
 	spin_unlock(&desc->lock);
 }



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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-31  1:52 genirq vs. fastack Benjamin Herrenschmidt
2006-05-31  8:38 ` Thomas Gleixner
2006-05-31  9:11   ` Benjamin Herrenschmidt
2006-05-31 10:19     ` [patch, -rc5-mm1] genirq: add chip->eoi(), fastack -> fasteoi Ingo Molnar
2006-05-31 21:23       ` Benjamin Herrenschmidt
2006-05-31 21:30         ` Ingo Molnar
2006-05-31 21:46           ` Benjamin Herrenschmidt

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