Skip to content

Commit 455a652

Browse files
Tobias Schumacherhcahca
authored andcommitted
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>
1 parent eb9780a commit 455a652

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/linux/irqdesc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ int generic_handle_irq_safe(unsigned int irq);
182182
* and handle the result interrupt number. Return -EINVAL if
183183
* conversion failed.
184184
*/
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);
188188
#endif
189189

190190
/* Test to see if a driver has successfully requested an irq */

kernel/irq/irqdesc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ EXPORT_SYMBOL_GPL(generic_handle_irq_safe);
720720
* This function must be called from an IRQ context with irq regs
721721
* initialized.
722722
*/
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)
724724
{
725725
return handle_irq_desc(irq_resolve_mapping(domain, hwirq));
726726
}
@@ -738,7 +738,7 @@ EXPORT_SYMBOL_GPL(generic_handle_domain_irq);
738738
* context). If the interrupt is marked as 'enforce IRQ-context only' then
739739
* the function must be invoked from hard interrupt context.
740740
*/
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)
742742
{
743743
unsigned long flags;
744744
int ret;
@@ -761,7 +761,7 @@ EXPORT_SYMBOL_GPL(generic_handle_domain_irq_safe);
761761
* This function must be called from an NMI context with irq regs
762762
* initialized.
763763
**/
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)
765765
{
766766
WARN_ON_ONCE(!in_nmi());
767767
return handle_irq_desc(irq_resolve_mapping(domain, hwirq));

0 commit comments

Comments
 (0)