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

genirq: Change hwirq parameter to irq_hw_number_t

The irqdomain implementation internally represents hardware IRQs as
irq_hw_number_t, which is defined as unsigned long int. When providing
an irq_hw_number_t to the generic_handle_domain() functions that expect
and unsigned int hwirq, this can lead to a loss of information. Change
the hwirq parameter to irq_hw_number_t to support the full range of
hwirqs.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Tobias Schumacher <ts@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Tobias Schumacher and committed by
Heiko Carstens
455a6526 eb9780a1

+6 -6
+3 -3
include/linux/irqdesc.h
··· 182 182 * and handle the result interrupt number. Return -EINVAL if 183 183 * conversion failed. 184 184 */ 185 - int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq); 186 - int generic_handle_domain_irq_safe(struct irq_domain *domain, unsigned int hwirq); 187 - int generic_handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq); 185 + int generic_handle_domain_irq(struct irq_domain *domain, irq_hw_number_t hwirq); 186 + int generic_handle_domain_irq_safe(struct irq_domain *domain, irq_hw_number_t hwirq); 187 + int generic_handle_domain_nmi(struct irq_domain *domain, irq_hw_number_t hwirq); 188 188 #endif 189 189 190 190 /* Test to see if a driver has successfully requested an irq */
+3 -3
kernel/irq/irqdesc.c
··· 720 720 * This function must be called from an IRQ context with irq regs 721 721 * initialized. 722 722 */ 723 - int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq) 723 + int generic_handle_domain_irq(struct irq_domain *domain, irq_hw_number_t hwirq) 724 724 { 725 725 return handle_irq_desc(irq_resolve_mapping(domain, hwirq)); 726 726 } ··· 738 738 * context). If the interrupt is marked as 'enforce IRQ-context only' then 739 739 * the function must be invoked from hard interrupt context. 740 740 */ 741 - int generic_handle_domain_irq_safe(struct irq_domain *domain, unsigned int hwirq) 741 + int generic_handle_domain_irq_safe(struct irq_domain *domain, irq_hw_number_t hwirq) 742 742 { 743 743 unsigned long flags; 744 744 int ret; ··· 761 761 * This function must be called from an NMI context with irq regs 762 762 * initialized. 763 763 **/ 764 - int generic_handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq) 764 + int generic_handle_domain_nmi(struct irq_domain *domain, irq_hw_number_t hwirq) 765 765 { 766 766 WARN_ON_ONCE(!in_nmi()); 767 767 return handle_irq_desc(irq_resolve_mapping(domain, hwirq));