mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: genirq: fasteoi change for retrigger
Date: Wed, 07 Jun 2006 16:10:16 +1000	[thread overview]
Message-ID: <1149660616.27572.138.camel@localhost.localdomain> (raw)

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);



             reply	other threads:[~2006-06-07  6:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-07  6:10 Benjamin Herrenschmidt [this message]
2006-06-07  8:33 ` Ingo Molnar
2006-06-07  8:40   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1149660616.27572.138.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®