Skip to contentSkip to conversation

mfd: rk8xx-core: Fix interrupt processing order for power key button

PATCH RESEND Applied Ondřej Jirman 2 participants 3 messages Feb 17, 2024 – Feb 23, 2024 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 mfd: rk8xx-core: Fix interrupt processing order for power key button

From: Ondrej Jirman <[email protected]>

Process rise event last, to avoid stuck keys when multiple interrupts are coalesced. This can happen typically when resuming from suspend via power key press and holding the power button for a bit too short, so that RISE an FALL IRQ flags are set before any interrupt routine has a chance to run.

Input subsystem will interpret it as holding down a power key for a long time, which leads to unintended initiation of shutdown UI on some OSes.

---
Sorry, resent without the bogous patch series numbering.

 drivers/mfd/rk8xx-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/rk8xx-core.c +1 -1
index b1ffc3b9e2be..e2261b68b844 100644
@@ -43,8 +43,8 @@ static struct resource rk806_pwrkey_resources[] = {
 };
 
 static const struct resource rk817_pwrkey_resources[] = {
-	DEFINE_RES_IRQ(RK817_IRQ_PWRON_RISE),
 	DEFINE_RES_IRQ(RK817_IRQ_PWRON_FALL),
+	DEFINE_RES_IRQ(RK817_IRQ_PWRON_RISE),
 };
 
 static const struct resource rk817_charger_resources[] = {
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw

Re: (subset) [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button

Quoted 11 lines · Ondřej Jirman

Process rise event last, to avoid stuck keys when multiple interrupts are coalesced. This can happen typically when resuming from suspend via power key press and holding the power button for a bit too short, so that RISE an FALL IRQ flags are set before any interrupt routine has a chance to run.

Input subsystem will interpret it as holding down a power key for a long time, which leads to unintended initiation of shutdown UI on some OSes.

[...]

Applied, thanks!

[1/1] mfd: rk8xx-core: Fix interrupt processing order for power key button

      commit: bda40bf667d8d26b157a69d821872b2ade59bfa4

--
Lee Jones [李琼斯]

maintainer
#2 lore raw
In reply to Ondřej Jirman
Quoted 24 lines · Ondřej Jirman

From: Ondrej Jirman <[email protected]>

Process rise event last, to avoid stuck keys when multiple interrupts are coalesced. This can happen typically when resuming from suspend via power key press and holding the power button for a bit too short, so that RISE an FALL IRQ flags are set before any interrupt routine has a chance to run.

Input subsystem will interpret it as holding down a power key for a long time, which leads to unintended initiation of shutdown UI on some OSes.

---
Sorry, resent without the bogous patch series numbering.

 drivers/mfd/rk8xx-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/rk8xx-core.c +0 -0
index b1ffc3b9e2be..e2261b68b844 100644

drivers/mfd/rk8xx-core.c static struct resource rk806_pwrkey_resources[] = { · line 47

Quoted 6 lines
drivers/mfd/rk8xx-core.c +1 -1
@@ -43,8 +43,8 @@ static struct resource rk806_pwrkey_resources[] = {
 };
 
 static const struct resource rk817_pwrkey_resources[] = {
-	DEFINE_RES_IRQ(RK817_IRQ_PWRON_RISE),
 	DEFINE_RES_IRQ(RK817_IRQ_PWRON_FALL),
+	DEFINE_RES_IRQ(RK817_IRQ_PWRON_RISE),

FWIW, basing solutions on ordering like this is often fragile!

Quoted 6 lines
drivers/mfd/rk8xx-core.c +0 -0
 };
 
 static const struct resource rk817_charger_resources[] = {
Signature · 1 line
2.43.0
Signature · 1 line
Lee Jones [李琼斯]