public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq: Fix gpio irq will fail to be resend under certain conditions
@ 2024-06-08 16:36 Zhenze Zhuang
  2024-06-10 19:25 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Zhenze Zhuang @ 2024-06-08 16:36 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, Zhenze Zhuang

When a gpio irq is disable and the wakeup function is enable, and
the device enters suspend, the irq wakeup is triggered but then enters
suspend, the IRQS_REPLAY flag will be set, but the IRQS_REPLAY will
not be cleared because the irq_may_run() condition is not met. After
the gpio irq is enabled and the suspend is entered again, after the
gpio irq is triggered, the check_irq_resend() execution will fail
because the IRQS_REPLAY is asserted, resulting in the interrupt not
being resned.

Signed-off-by: Zhenze Zhuang <luuiiruo@163.com>
---
 kernel/irq/chip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index dc94e0bf2c94..8800db8d655c 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -690,6 +690,8 @@ void handle_fasteoi_irq(struct irq_desc *desc)
 
 	raw_spin_lock(&desc->lock);
 
+	desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
+
 	/*
 	 * When an affinity change races with IRQ handling, the next interrupt
 	 * can arrive on the new CPU before the original CPU has completed
@@ -701,8 +703,6 @@ void handle_fasteoi_irq(struct irq_desc *desc)
 		goto out;
 	}
 
-	desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
-
 	/*
 	 * If its disabled or no action available
 	 * then mask it and get out of here:
-- 
2.34.1


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

end of thread, other threads:[~2024-06-11 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-08 16:36 [PATCH] genirq: Fix gpio irq will fail to be resend under certain conditions Zhenze Zhuang
2024-06-10 19:25 ` Thomas Gleixner
2024-06-11 15:41   ` zzz

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