Skip to content

Commit 2334c45

Browse files
committed
genirq/chip: Rework handle_level_irq()
Use the new helpers to decide whether the interrupt should be handled and switch the descriptor locking to guard(). Fixup the kernel doc comment while at it. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20250429065420.926362488@linutronix.de
1 parent a155777 commit 2334c45

1 file changed

Lines changed: 9 additions & 23 deletions

File tree

kernel/irq/chip.c

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -609,40 +609,26 @@ static void cond_unmask_irq(struct irq_desc *desc)
609609
}
610610

611611
/**
612-
* handle_level_irq - Level type irq handler
613-
* @desc: the interrupt description structure for this irq
612+
* handle_level_irq - Level type irq handler
613+
* @desc: the interrupt description structure for this irq
614614
*
615-
* Level type interrupts are active as long as the hardware line has
616-
* the active level. This may require to mask the interrupt and unmask
617-
* it after the associated handler has acknowledged the device, so the
618-
* interrupt line is back to inactive.
615+
* Level type interrupts are active as long as the hardware line has the
616+
* active level. This may require to mask the interrupt and unmask it after
617+
* the associated handler has acknowledged the device, so the interrupt
618+
* line is back to inactive.
619619
*/
620620
void handle_level_irq(struct irq_desc *desc)
621621
{
622-
raw_spin_lock(&desc->lock);
622+
guard(raw_spinlock)(&desc->lock);
623623
mask_ack_irq(desc);
624624

625-
if (!irq_can_handle_pm(desc))
626-
goto out_unlock;
627-
628-
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
629-
630-
/*
631-
* If its disabled or no action available
632-
* keep it masked and get out of here
633-
*/
634-
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
635-
desc->istate |= IRQS_PENDING;
636-
goto out_unlock;
637-
}
625+
if (!irq_can_handle(desc))
626+
return;
638627

639628
kstat_incr_irqs_this_cpu(desc);
640629
handle_irq_event(desc);
641630

642631
cond_unmask_irq(desc);
643-
644-
out_unlock:
645-
raw_spin_unlock(&desc->lock);
646632
}
647633
EXPORT_SYMBOL_GPL(handle_level_irq);
648634

0 commit comments

Comments
 (0)