mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] genirq: Resend pending interrupts after handle_simple_irq()
@ 2026-11-01  4:56 Avi Weiss
  2026-11-01  9:50 ` Marc Zyngier
  0 siblings, 1 reply; 2+ messages in thread
From: Avi Weiss @ 2026-11-01  4:56 UTC (permalink / raw)
  To: tglx; +Cc: radu, maz, linux-kernel, Avi Weiss

Commit 2c9e7f857400 ("genirq: Teach handle_simple_irq() to resend an
in-progress interrupt") records a concurrent interrupt as IRQS_PENDING
when another CPU is still handling the IRQ. However, handle_simple_irq()
does not consume the pending state after the first handler completes,
so an interrupt arriving during an affinity change can be lost.

Check IRQS_PENDING after handle_irq_event() and request a resend, as
handle_fasteoi_irq() already does.

Fixes: 2c9e7f857400 ("genirq: Teach handle_simple_irq() to resend an in-progress interrupt")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---

Related 2025 patch/review: https://lore.kernel.org/r/20250708173404.1278635-2-maz@kernel.org
 kernel/irq/chip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index de754db414d1..4a131dd72196 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -626,6 +626,8 @@ void handle_simple_irq(struct irq_desc *desc)
 
 	kstat_incr_irqs_this_cpu(desc);
 	handle_irq_event(desc);
+	if (unlikely(desc->istate & IRQS_PENDING))
+		check_irq_resend(desc, false);
 }
 EXPORT_SYMBOL_GPL(handle_simple_irq);
 

base-commit: e9954f3fbddd25e1a01b7e5a0b72fb8b564204e0
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] genirq: Resend pending interrupts after handle_simple_irq()
  2026-11-01  4:56 [PATCH] genirq: Resend pending interrupts after handle_simple_irq() Avi Weiss
@ 2026-11-01  9:50 ` Marc Zyngier
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2026-11-01  9:50 UTC (permalink / raw)
  To: Avi Weiss; +Cc: tglx, radu, linux-kernel

On Sun, 01 Nov 2026 04:56:28 +0000,
Avi Weiss <thnkslprpt@gmail.com> wrote:
> 
> Commit 2c9e7f857400 ("genirq: Teach handle_simple_irq() to resend an
> in-progress interrupt") records a concurrent interrupt as IRQS_PENDING
> when another CPU is still handling the IRQ. However, handle_simple_irq()
> does not consume the pending state after the first handler completes,
> so an interrupt arriving during an affinity change can be lost.
>

This commit message isn't quite accurate.

"Consuming" has a particular meaning for edge-triggered interrupts,
and indicates that the interrupt is not pending anymore. Here, the bug
is that we don't check for the race after the initial handling, and
while the interrupt is still pending (hence not really lost), the
signalling is the missing part.

> Check IRQS_PENDING after handle_irq_event() and request a resend, as
> handle_fasteoi_irq() already does.

And then this sentence makes perfect sense.

> 
> Fixes: 2c9e7f857400 ("genirq: Teach handle_simple_irq() to resend an in-progress interrupt")
> Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
> ---
> 
> Related 2025 patch/review: https://lore.kernel.org/r/20250708173404.1278635-2-maz@kernel.org
>  kernel/irq/chip.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index de754db414d1..4a131dd72196 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -626,6 +626,8 @@ void handle_simple_irq(struct irq_desc *desc)
>  
>  	kstat_incr_irqs_this_cpu(desc);
>  	handle_irq_event(desc);
> +	if (unlikely(desc->istate & IRQS_PENDING))
> +		check_irq_resend(desc, false);
>  }
>  EXPORT_SYMBOL_GPL(handle_simple_irq);

Other than the nits above:

Reviewed-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-01  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-01  4:56 [PATCH] genirq: Resend pending interrupts after handle_simple_irq() Avi Weiss
2026-11-01  9:50 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®