From: tip-bot for Grant Likely <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, grant.likely@linaro.org,
hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de
Subject: [tip:irq/core] genirq: irqchip: Add mask to block out invalid irqs
Date: Wed, 29 May 2013 02:23:37 -0700 [thread overview]
Message-ID: <tip-e8bd834f73714378ef110a64287db1b77033c8da@git.kernel.org> (raw)
In-Reply-To: <1369793454-19197-2-git-send-email-grant.likely@linaro.org>
Commit-ID: e8bd834f73714378ef110a64287db1b77033c8da
Gitweb: http://git.kernel.org/tip/e8bd834f73714378ef110a64287db1b77033c8da
Author: Grant Likely <grant.likely@linaro.org>
AuthorDate: Wed, 29 May 2013 03:10:52 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 29 May 2013 10:57:11 +0200
genirq: irqchip: Add mask to block out invalid irqs
Some controllers have irqs that aren't wired up and must never be used.
For the generic chip attached to an irq_domain this provides a mask that
can be used to block out particular irqs so that they never get mapped.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Link: http://lkml.kernel.org/r/1369793454-19197-2-git-send-email-grant.likely@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/irq.h | 2 ++
kernel/irq/generic-chip.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index af7052c..298a9b9 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -679,6 +679,7 @@ struct irq_chip_type {
* @num_ct: Number of available irq_chip_type instances (usually 1)
* @private: Private data for non generic chip callbacks
* @installed: bitfield to denote installed interrupts
+ * @unused: bitfield to denote unused interrupts
* @domain: irq domain pointer
* @list: List head for keeping track of instances
* @chip_types: Array of interrupt irq_chip_types
@@ -702,6 +703,7 @@ struct irq_chip_generic {
unsigned int num_ct;
void *private;
unsigned long installed;
+ unsigned long unused;
struct irq_domain *domain;
struct list_head list;
struct irq_chip_type chip_types[0];
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index 8743d62..95575d8 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -359,6 +359,9 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
idx = hw_irq % dgc->irqs_per_chip;
+ if (test_bit(idx, &gc->unused))
+ return -ENOTSUPP;
+
if (test_bit(idx, &gc->installed))
return -EBUSY;
next prev parent reply other threads:[~2013-05-29 9:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 2:10 [PATCH 0/3] Try out the irqdomain + generic chip integration series Grant Likely
2013-05-29 2:10 ` [PATCH 1/3] irqchip: Add mask to block out invalid irqs Grant Likely
2013-05-29 9:23 ` tip-bot for Grant Likely [this message]
2013-05-29 2:10 ` [PATCH 2/3] irqdomain: Relax failure path on setting up mappings Grant Likely
2013-05-29 2:10 ` [PATCH 3/3] irqchip: Make versatile fpga irq driver a generic chip Grant Likely
2013-05-29 17:55 ` Linus Walleij
2013-05-29 19:56 ` Grant Likely
2013-05-30 21:06 ` Linus Walleij
2013-05-29 8:19 ` [PATCH 0/3] Try out the irqdomain + generic chip integration series 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=tip-e8bd834f73714378ef110a64287db1b77033c8da@git.kernel.org \
--to=tipbot@zytor.com \
--cc=grant.likely@linaro.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--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