public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* genirq: fasteoi change for retrigger
@ 2006-06-07  6:10 Benjamin Herrenschmidt
  2006-06-07  8:33 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2006-06-07  6:10 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner; +Cc: Linux Kernel list

Hi Ingo, Thomas.

Would you be ok with a small change to the fasteoi handler that

 - If the interrupt happens while disabled, rather than just doing goto
out, also mark it pending
 - In the normal handling code path, clear pending.

That would allow some sort of soft-disable to work with fasteoi.

My issue here is on Cell. I have a very strange interrupt controller
that can't mask interrupts. 

They are all edges though (it's the internal controller of the chip, it
only takes messages from other units, possible level interrupts coming
from devices have to go through a separate cascaded external
controller).

It's also essentially a fasteoi controller: reading the irq number
automatically raises the controller priority to that of that interrupt
and the "EOI" is actually done by pushing the priority back down.

However, I cannot mask those interrupts in hardware. If an interrupt is
disabled with disable_irq(), it will have IRQ_DISABLED set, but may
still happen. In that case, it will be properly "skipped" by the fasteoi
handler. But the current handler won't keep track of the fact that it
happened, thus preventing me from having a re-trigger logic when that
interrupt is later re-enabled.

The patch below implements it.

Also, on another note, both the other handlers and my patch on fasteoi,
when an interrupt happens like that, will mask it as IRQ_PENDING if
disabled _or_ if it has no action. However, in the later case, adding an
action (via request_irq() -> setup_irq() will not test nor clear
IRQ_PENDING. It will be stale. Note sure how much of a problem that is
but worth noticing... 

Cheers,
Ben.

Index: linux-work/kernel/irq/chip.c
===================================================================
--- linux-work.orig/kernel/irq/chip.c	2006-06-05 17:55:31.000000000 +1000
+++ linux-work/kernel/irq/chip.c	2006-06-07 16:01:59.000000000 +1000
@@ -312,10 +312,13 @@ handle_fasteoi_irq(unsigned int irq, str
 	 * keep it masked and get out of here
 	 */
 	action = desc->action;
-	if (unlikely(!action || (desc->status & IRQ_DISABLED)))
+	if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
+		desc->status |= IRQ_PENDING;
 		goto out;
+	}
 
 	desc->status |= IRQ_INPROGRESS;
+	desc->status &= ~IRQ_PENDING;
 	spin_unlock(&desc->lock);
 
 	action_ret = handle_IRQ_event(irq, regs, action);



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

* Re: genirq: fasteoi change for retrigger
  2006-06-07  6:10 genirq: fasteoi change for retrigger Benjamin Herrenschmidt
@ 2006-06-07  8:33 ` Ingo Molnar
  2006-06-07  8:40   ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2006-06-07  8:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Thomas Gleixner, Linux Kernel list


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

> Hi Ingo, Thomas.
> 
> Would you be ok with a small change to the fasteoi handler that
> 
>  - If the interrupt happens while disabled, rather than just doing goto
> out, also mark it pending
>  - In the normal handling code path, clear pending.
> 
> That would allow some sort of soft-disable to work with fasteoi.
> 
> My issue here is on Cell. I have a very strange interrupt controller 
> that can't mask interrupts.

sure, it looks reasonable to me. Thomas?

	Ingo

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

* Re: genirq: fasteoi change for retrigger
  2006-06-07  8:33 ` Ingo Molnar
@ 2006-06-07  8:40   ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2006-06-07  8:40 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Benjamin Herrenschmidt, Linux Kernel list

On Wed, 2006-06-07 at 10:33 +0200, Ingo Molnar wrote:
> * Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> 
> > Hi Ingo, Thomas.
> > 
> > Would you be ok with a small change to the fasteoi handler that
> > 
> >  - If the interrupt happens while disabled, rather than just doing goto
> > out, also mark it pending
> >  - In the normal handling code path, clear pending.
> > 
> > That would allow some sort of soft-disable to work with fasteoi.
> > 
> > My issue here is on Cell. I have a very strange interrupt controller 
> > that can't mask interrupts.
> 
> sure, it looks reasonable to me. Thomas?

No objections.

	tglx



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

end of thread, other threads:[~2006-06-07 12:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-07  6:10 genirq: fasteoi change for retrigger Benjamin Herrenschmidt
2006-06-07  8:33 ` Ingo Molnar
2006-06-07  8:40   ` Thomas Gleixner

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