linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] ARM: irq: introduce entry and exit functions for chained handlers
Date: Tue,  8 Mar 2011 17:13:19 +0000	[thread overview]
Message-ID: <1299604405-12960-2-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1299604405-12960-1-git-send-email-will.deacon@arm.com>

Some chained IRQ handlers are written to cope with primary chips of
potentially different flow types. Whether this a sensible thing to do
is a point of contention.

This patch introduces entry/exit functions for chained handlers which
infer the flow type of the primary chip by checking whether or not
the ->irq_eoi function pointer is present and calling back to the
primary chip as necessary.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/include/asm/mach/irq.h |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
index 22ac140..34d1de8 100644
--- a/arch/arm/include/asm/mach/irq.h
+++ b/arch/arm/include/asm/mach/irq.h
@@ -34,4 +34,31 @@ do {							\
 	raw_spin_unlock(&desc->lock);			\
 } while(0)
 
+#ifndef __ASSEMBLY__
+static inline void chained_irq_enter(struct irq_chip *chip,
+				     struct irq_desc *desc)
+{
+	/* FastEOI controllers require no action on entry. */
+	if (chip->irq_eoi)
+		return;
+
+	if (chip->irq_mask_ack) {
+		chip->irq_mask_ack(&desc->irq_data);
+	} else {
+		chip->irq_mask(&desc->irq_data);
+		if (chip->irq_ack)
+			chip->irq_ack(&desc->irq_data);
+	}
+}
+
+static inline void chained_irq_exit(struct irq_chip *chip,
+				    struct irq_desc *desc)
+{
+	if (chip->irq_eoi)
+		chip->irq_eoi(&desc->irq_data);
+	else
+		chip->irq_unmask(&desc->irq_data);
+}
+#endif
+
 #endif
-- 
1.7.0.4

  reply	other threads:[~2011-03-08 17:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 17:13 [PATCH v3 0/7] Migrate GIC to fasteoi flow control Will Deacon
2011-03-08 17:13 ` Will Deacon [this message]
2011-03-11 16:33   ` [PATCH 1/7] ARM: irq: introduce entry and exit functions for chained handlers Thomas Gleixner
2011-03-11 16:56     ` Will Deacon
2011-03-11 19:19       ` Thomas Gleixner
2011-03-14 13:04         ` Will Deacon
2011-03-08 17:13 ` [PATCH 2/7] ARM: omap: update GPIO chained IRQ handler to use entry/exit functions Will Deacon
2011-03-08 17:13 ` [PATCH 3/7] ARM: tegra: " Will Deacon
2011-03-08 17:13 ` [PATCH 4/7] ARM: s5pv310: update IRQ combiner to use chained " Will Deacon
2011-03-08 17:13 ` [PATCH 5/7] ARM: msm: update GPIO chained IRQ handler to use " Will Deacon
2011-03-08 17:13 ` [PATCH 6/7] ARM: nmk: update GPIO chained IRQ handler to " Will Deacon
2011-03-08 17:13 ` [PATCH 7/7] ARM: gic: use handle_fasteoi_irq for SPIs Will Deacon
2011-03-11 15:59 ` [PATCH v3 0/7] Migrate GIC to fasteoi flow control Will Deacon

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=1299604405-12960-2-git-send-email-will.deacon@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).