[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250313155915.094037144@linutronix.de>
Date: Thu, 13 Mar 2025 17:00:13 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Jiri Slaby <jirislaby@...nel.org>
Subject: [patch 18/46] genirq/chip: Rework handle_edge_eoi_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@...utronix.de>
---
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
Powered by blists - more mailing lists