public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button
@ 2024-02-17 19:56 Ondřej Jirman
  2024-02-23 16:14 ` (subset) " Lee Jones
  2024-02-23 16:15 ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Ondřej Jirman @ 2024-02-17 19:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ondrej Jirman, Lee Jones

From: Ondrej Jirman <megi@xff.cz>

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.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
Sorry, resent without the bogous patch series numbering.

 drivers/mfd/rk8xx-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
index b1ffc3b9e2be..e2261b68b844 100644
--- a/drivers/mfd/rk8xx-core.c
+++ b/drivers/mfd/rk8xx-core.c
@@ -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[] = {
-- 
2.43.0


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

* Re: (subset) [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button
  2024-02-17 19:56 [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button Ondřej Jirman
@ 2024-02-23 16:14 ` Lee Jones
  2024-02-23 16:15 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2024-02-23 16:14 UTC (permalink / raw)
  To: linux-kernel, Ondřej Jirman; +Cc: Lee Jones

On Sat, 17 Feb 2024 20:56:13 +0100, Ondřej Jirman wrote:
> 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 [李琼斯]


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

* Re: [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button
  2024-02-17 19:56 [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button Ondřej Jirman
  2024-02-23 16:14 ` (subset) " Lee Jones
@ 2024-02-23 16:15 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2024-02-23 16:15 UTC (permalink / raw)
  To: Ondřej Jirman; +Cc: linux-kernel

On Sat, 17 Feb 2024, Ondřej Jirman wrote:

> From: Ondrej Jirman <megi@xff.cz>
> 
> 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.
> 
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> ---
> Sorry, resent without the bogous patch series numbering.
> 
>  drivers/mfd/rk8xx-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
> index b1ffc3b9e2be..e2261b68b844 100644
> --- a/drivers/mfd/rk8xx-core.c
> +++ b/drivers/mfd/rk8xx-core.c
> @@ -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!

>  };
>  
>  static const struct resource rk817_charger_resources[] = {
> -- 
> 2.43.0
> 

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2024-02-23 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-17 19:56 [RESEND PATCH] mfd: rk8xx-core: Fix interrupt processing order for power key button Ondřej Jirman
2024-02-23 16:14 ` (subset) " Lee Jones
2024-02-23 16:15 ` Lee Jones

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