aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/irq.h2
-rw-r--r--kernel/irq/generic-chip.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index af7052c6a45..298a9b9ce67 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 8743d62fded..95575d8d539 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;