Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Grant Likely and committed by
Thomas Gleixner
e8bd834f 088f40b7

+5
+2
include/linux/irq.h
··· 679 679 * @num_ct: Number of available irq_chip_type instances (usually 1) 680 680 * @private: Private data for non generic chip callbacks 681 681 * @installed: bitfield to denote installed interrupts 682 + * @unused: bitfield to denote unused interrupts 682 683 * @domain: irq domain pointer 683 684 * @list: List head for keeping track of instances 684 685 * @chip_types: Array of interrupt irq_chip_types ··· 703 702 unsigned int num_ct; 704 703 void *private; 705 704 unsigned long installed; 705 + unsigned long unused; 706 706 struct irq_domain *domain; 707 707 struct list_head list; 708 708 struct irq_chip_type chip_types[0];
+3
kernel/irq/generic-chip.c
··· 359 359 360 360 idx = hw_irq % dgc->irqs_per_chip; 361 361 362 + if (test_bit(idx, &gc->unused)) 363 + return -ENOTSUPP; 364 + 362 365 if (test_bit(idx, &gc->installed)) 363 366 return -EBUSY; 364 367