Skip to content

Commit e8bd834

Browse files
glikelyKAGA-KOKO
authored andcommitted
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>
1 parent 088f40b commit e8bd834

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/linux/irq.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ struct irq_chip_type {
679679
* @num_ct: Number of available irq_chip_type instances (usually 1)
680680
* @private: Private data for non generic chip callbacks
681681
* @installed: bitfield to denote installed interrupts
682+
* @unused: bitfield to denote unused interrupts
682683
* @domain: irq domain pointer
683684
* @list: List head for keeping track of instances
684685
* @chip_types: Array of interrupt irq_chip_types
@@ -702,6 +703,7 @@ struct irq_chip_generic {
702703
unsigned int num_ct;
703704
void *private;
704705
unsigned long installed;
706+
unsigned long unused;
705707
struct irq_domain *domain;
706708
struct list_head list;
707709
struct irq_chip_type chip_types[0];

‎kernel/irq/generic-chip.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
359359

360360
idx = hw_irq % dgc->irqs_per_chip;
361361

362+
if (test_bit(idx, &gc->unused))
363+
return -ENOTSUPP;
364+
362365
if (test_bit(idx, &gc->installed))
363366
return -EBUSY;
364367

0 commit comments

Comments
 (0)