From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Jeremy Kerr <jk@ozlabs.org>, Arnd Bergmann <arnd@arndb.de>
Subject: [patch 4/8] genirq: Introduce IRQ_EDGE_EOI flag
Date: Wed, 02 Feb 2011 21:41:20 -0000 [thread overview]
Message-ID: <20110202212552.044020100@linutronix.de> (raw)
In-Reply-To: 20110202212258.546660886@linutronix.de
[-- Attachment #1: genirq-introduce-edge-eoi-flag.patch --]
[-- Type: text/plain, Size: 2727 bytes --]
powerpc/cell has a slightly modified version of the edge handler. The
main difference is that it does not ack and mask, but uses
eoi. handle_edge_irq is an oddball handler anyway, which should be
avoided wherever it can. So it's not worth to have a slightly
different copy around.
Add a special flag to reuse handle_edge_irq for this odd case.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Arnd Bergmann <arnd@arndb.de>
---
include/linux/irq.h | 3 ++-
kernel/irq/chip.c | 11 ++++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -71,10 +71,11 @@ typedef void (*irq_flow_handler_t)(unsig
#define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */
#define IRQ_ONESHOT 0x08000000 /* IRQ is not unmasked after hardirq */
#define IRQ_NESTED_THREAD 0x10000000 /* IRQ is nested into another, no own handler thread */
+#define IRQ_EDGE_EOI 0x20000000 /* IRQ abuses edge handler with EOI */
#define IRQF_MODIFY_MASK \
(IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
- IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL)
+ IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_EDGE_EOI)
#ifdef CONFIG_IRQ_PER_CPU
# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -633,13 +633,15 @@ handle_edge_irq(unsigned int irq, struct
if (unlikely((desc->status & (IRQ_INPROGRESS | IRQ_DISABLED)) ||
!desc->action)) {
desc->status |= IRQ_PENDING;
- mask_ack_irq(desc);
+ if (!(desc->status & IRQ_EDGE_EOI))
+ mask_ack_irq(desc);
goto out_unlock;
}
kstat_incr_irqs_this_cpu(irq, desc);
/* Start handling the irq */
- desc->irq_data.chip->irq_ack(&desc->irq_data);
+ if (!(desc->status & IRQ_EDGE_EOI))
+ desc->irq_data.chip->irq_ack(&desc->irq_data);
/* Mark the IRQ currently in progress.*/
desc->status |= IRQ_INPROGRESS;
@@ -649,7 +651,8 @@ handle_edge_irq(unsigned int irq, struct
irqreturn_t action_ret;
if (unlikely(!action)) {
- mask_irq(desc);
+ if (!(desc->status & IRQ_EDGE_EOI))
+ mask_irq(desc);
goto out_unlock;
}
@@ -675,6 +678,8 @@ handle_edge_irq(unsigned int irq, struct
desc->status &= ~IRQ_INPROGRESS;
out_unlock:
+ if (desc->status & IRQ_EDGE_EOI)
+ desc->irq_data.chip->irq_eoi(&desc->irq_data);
raw_spin_unlock(&desc->lock);
}
next prev parent reply other threads:[~2011-02-02 21:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-02 21:41 [patch 0/8] genirq: Further cleanups for .39 Thomas Gleixner
2011-02-02 21:41 ` [patch 1/8] genirq: Remove bogus conditional Thomas Gleixner
2011-02-19 12:22 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2011-02-02 21:41 ` [patch 2/8] genirq: Consolidate startup/shutdown of interrupts Thomas Gleixner
2011-02-19 12:22 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2011-02-02 21:41 ` [patch 3/8] genirq: Do not fiddle with IRQ_MASKED in handle_edge_irq() Thomas Gleixner
2011-02-19 12:24 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2011-02-02 21:41 ` Thomas Gleixner [this message]
2011-02-02 21:41 ` [patch 5/8] powerpc: cell: Use handle_edge_irq Thomas Gleixner
2011-02-02 21:41 ` [patch 6/8] arm: ns9xxx: Remove private irq flow handler Thomas Gleixner
2011-02-02 21:41 ` Thomas Gleixner
2011-02-03 7:56 ` Uwe Kleine-König
2011-02-03 7:56 ` Uwe Kleine-König
2011-03-28 17:13 ` [tip:irq/urgent] arm: Ns9xxx: " tip-bot for Thomas Gleixner
2011-02-02 21:41 ` [patch 7/8] m68knommu: 5772: Replace " Thomas Gleixner
2011-02-02 22:27 ` Greg Ungerer
2011-02-02 22:37 ` Thomas Gleixner
2011-02-02 22:41 ` Greg Ungerer
2011-02-02 21:41 ` [patch 8/8] genirq: Make handle_IRQ_event private to the core code 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=20110202212552.044020100@linutronix.de \
--to=tglx@linutronix.de \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=jk@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.