[patch 18/46] genirq/chip: Rework handle_edge_eoi_irq()

From: Thomas Gleixner
Date: Thu Mar 13 2025 - 12:06:20 EST


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@xxxxxxxxxxxxx>
---
kernel/irq/chip.c | 31 ++++++++-----------------------
1 file changed, 8 insertions(+), 23 deletions(-)

--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -795,8 +795,8 @@ EXPORT_SYMBOL(handle_edge_irq);

#ifdef CONFIG_IRQ_EDGE_EOI_HANDLER
/**
- * handle_edge_eoi_irq - edge eoi type IRQ handler
- * @desc: the interrupt description structure for this irq
+ * handle_edge_eoi_irq - edge eoi type IRQ handler
+ * @desc: the interrupt description structure for this irq
*
* Similar as the above handle_edge_irq, but using eoi and w/o the
* mask/unmask logic.
@@ -805,38 +805,23 @@ void handle_edge_eoi_irq(struct irq_desc
{
struct irq_chip *chip = irq_desc_get_chip(desc);

- raw_spin_lock(&desc->lock);
+ guard(raw_spinlock)(&desc->lock);

- desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
-
- if (!irq_can_handle_pm(desc)) {
- desc->istate |= IRQS_PENDING;
- goto out_eoi;
- }
-
- /*
- * If its disabled or no action available then mask it and get
- * out of here.
- */
- if (irqd_irq_disabled(&desc->irq_data) || !desc->action) {
+ if (!irq_can_handle(desc)) {
desc->istate |= IRQS_PENDING;
- goto out_eoi;
+ chip->irq_eoi(&desc->irq_data);
+ return;
}

kstat_incr_irqs_this_cpu(desc);

do {
if (unlikely(!desc->action))
- goto out_eoi;
-
+ break;
handle_irq_event(desc);
+ } while ((desc->istate & IRQS_PENDING) && !irqd_irq_disabled(&desc->irq_data));

- } while ((desc->istate & IRQS_PENDING) &&
- !irqd_irq_disabled(&desc->irq_data));
-
-out_eoi:
chip->irq_eoi(&desc->irq_data);
- raw_spin_unlock(&desc->lock);
}
#endif