[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e8bd834f73714378ef110a64287db1b77033c8da@git.kernel.org>
Date: Wed, 29 May 2013 02:23:37 -0700
From: tip-bot for Grant Likely <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, grant.likely@...aro.org,
hpa@...or.com, mingo@...nel.org, tglx@...utronix.de
Subject: [tip:irq/core] genirq: irqchip:
Add mask to block out invalid irqs
Commit-ID: e8bd834f73714378ef110a64287db1b77033c8da
Gitweb: http://git.kernel.org/tip/e8bd834f73714378ef110a64287db1b77033c8da
Author: Grant Likely <grant.likely@...aro.org>
AuthorDate: Wed, 29 May 2013 03:10:52 +0100
Committer: Thomas Gleixner <tglx@...utronix.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@...aro.org>
Link: http://lkml.kernel.org/r/1369793454-19197-2-git-send-email-grant.likely@linaro.org
Signed-off-by: Thomas Gleixner <tglx@...utronix.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists