diff options
-rw-r--r-- | include/linux/irq.h | 2 | ||||
-rw-r--r-- | kernel/irq/generic-chip.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index af7052c6a45c..298a9b9ce675 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -679,6 +679,7 @@ struct irq_chip_type { | |||
679 | * @num_ct: Number of available irq_chip_type instances (usually 1) | 679 | * @num_ct: Number of available irq_chip_type instances (usually 1) |
680 | * @private: Private data for non generic chip callbacks | 680 | * @private: Private data for non generic chip callbacks |
681 | * @installed: bitfield to denote installed interrupts | 681 | * @installed: bitfield to denote installed interrupts |
682 | * @unused: bitfield to denote unused interrupts | ||
682 | * @domain: irq domain pointer | 683 | * @domain: irq domain pointer |
683 | * @list: List head for keeping track of instances | 684 | * @list: List head for keeping track of instances |
684 | * @chip_types: Array of interrupt irq_chip_types | 685 | * @chip_types: Array of interrupt irq_chip_types |
@@ -702,6 +703,7 @@ struct irq_chip_generic { | |||
702 | unsigned int num_ct; | 703 | unsigned int num_ct; |
703 | void *private; | 704 | void *private; |
704 | unsigned long installed; | 705 | unsigned long installed; |
706 | unsigned long unused; | ||
705 | struct irq_domain *domain; | 707 | struct irq_domain *domain; |
706 | struct list_head list; | 708 | struct list_head list; |
707 | struct irq_chip_type chip_types[0]; | 709 | struct irq_chip_type chip_types[0]; |
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index 8743d62fded7..95575d8d5392 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, | |||
359 | 359 | ||
360 | idx = hw_irq % dgc->irqs_per_chip; | 360 | idx = hw_irq % dgc->irqs_per_chip; |
361 | 361 | ||
362 | if (test_bit(idx, &gc->unused)) | ||
363 | return -ENOTSUPP; | ||
364 | |||
362 | if (test_bit(idx, &gc->installed)) | 365 | if (test_bit(idx, &gc->installed)) |
363 | return -EBUSY; | 366 | return -EBUSY; |
364 | 367 | ||