Commit e8bd834f authored by Grant Likely's avatar Grant Likely Committed by Thomas Gleixner

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: default avatarGrant Likely <grant.likely@linaro.org>
Link: http://lkml.kernel.org/r/1369793454-19197-2-git-send-email-grant.likely@linaro.orgSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 088f40b7
...@@ -679,6 +679,7 @@ struct irq_chip_type { ...@@ -679,6 +679,7 @@ struct irq_chip_type {
* @num_ct: Number of available irq_chip_type instances (usually 1) * @num_ct: Number of available irq_chip_type instances (usually 1)
* @private: Private data for non generic chip callbacks * @private: Private data for non generic chip callbacks
* @installed: bitfield to denote installed interrupts * @installed: bitfield to denote installed interrupts
* @unused: bitfield to denote unused interrupts
* @domain: irq domain pointer * @domain: irq domain pointer
* @list: List head for keeping track of instances * @list: List head for keeping track of instances
* @chip_types: Array of interrupt irq_chip_types * @chip_types: Array of interrupt irq_chip_types
...@@ -702,6 +703,7 @@ struct irq_chip_generic { ...@@ -702,6 +703,7 @@ struct irq_chip_generic {
unsigned int num_ct; unsigned int num_ct;
void *private; void *private;
unsigned long installed; unsigned long installed;
unsigned long unused;
struct irq_domain *domain; struct irq_domain *domain;
struct list_head list; struct list_head list;
struct irq_chip_type chip_types[0]; struct irq_chip_type chip_types[0];
......
...@@ -359,6 +359,9 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq, ...@@ -359,6 +359,9 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
idx = hw_irq % dgc->irqs_per_chip; idx = hw_irq % dgc->irqs_per_chip;
if (test_bit(idx, &gc->unused))
return -ENOTSUPP;
if (test_bit(idx, &gc->installed)) if (test_bit(idx, &gc->installed))
return -EBUSY; return -EBUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment