All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86/intel/hid: Ignore power button release in wakeup mode
@ 2024-04-01 13:39 Enrik Berkhan
  2024-04-01 15:25 ` Enrik Berkhan
  0 siblings, 1 reply; 2+ messages in thread
From: Enrik Berkhan @ 2024-04-01 13:39 UTC (permalink / raw
  To: Alex Hung
  Cc: Hans de Goede, Ilpo Järvinen, platform-driver-x86,
	linux-kernel, Rafael J. Wysocki, Enrik Berkhan

Since commit 0c4cae1bc00d ("PM: hibernate: Avoid missing wakeup events
during hibernation"), the return value of hibernation_platform_enter() is
used. This will, for example, cancel every hibernation attempt if a wakeup
event is registered during the (long) preparation time needed before
entering platform hibernate mode.

As reported in https://bugzilla.kernel.org/show_bug.cgi?id=218634 several
notebooks will fail to hibernate since then, logging "PM: hibernation:
Wakeup event detected during hibernation, rolling back." (Looks like mostly
Dell systems are affected.)

A little investigation has shown that at least one affected device's "Intel
5 button array" sends spurious "Power button release" events (0xCF) in this
case. Most probably, this is completely independent from the
hibernation_platform_enter() change above, and even with kernels before
6.8, the hibernation was probably not fully prepared before halting the
system, i.e., hibernation_platform_enter() may have failed early and the
failure has been ignored.

It ist he spurious "Power button release" event that leads to a wakeup
during the hibernation preparation. Therefore, ignore these events while
the intel-hid driver is in "wakeup mode". "Power button press" will still
be processed as before to not disturb the wakeup from S2Idle.

Only tested on one Dell Inspiron 16 (7640) having BIOS 1.3.0, so far.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=218634
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218634

Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
---
 drivers/platform/x86/intel/hid.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c
index 7457ca2b27a6..9df4a114334a 100644
--- a/drivers/platform/x86/intel/hid.c
+++ b/drivers/platform/x86/intel/hid.c
@@ -528,6 +528,13 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
 		 */
 		if (event == 0xce)
 			goto wakeup;
+		/*
+		 * Other platforms may send spurious notifies for power button
+		 * release while entering hibernation mode. Ignore these in
+		 * wakeup mode.
+		 */
+		if (event == 0xcf)
+			return;
 
 		/*
 		 * Some devices send (duplicate) tablet-mode events when moved
-- 
2.44.0


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

* Re: [PATCH] platform/x86/intel/hid: Ignore power button release in wakeup mode
  2024-04-01 13:39 [PATCH] platform/x86/intel/hid: Ignore power button release in wakeup mode Enrik Berkhan
@ 2024-04-01 15:25 ` Enrik Berkhan
  0 siblings, 0 replies; 2+ messages in thread
From: Enrik Berkhan @ 2024-04-01 15:25 UTC (permalink / raw
  To: Alex Hung, David McFarland
  Cc: Hans de Goede, Ilpo Järvinen, platform-driver-x86,
	linux-kernel, Rafael J. Wysocki

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, 2024-04-01 at 15:39 +0200, Enrik Berkhan wrote:
> Since commit 0c4cae1bc00d ("PM: hibernate: Avoid missing wakeup
> events
> during hibernation"), the return value of
> hibernation_platform_enter() is
> used. This will, for example, cancel every hibernation attempt if a
> wakeup
> event is registered during the (long) preparation time needed before
> entering platform hibernate mode.

Oops, too late, already obsoleted by
https://lore.kernel.org/all/20240318191153.6978-2-corngood@gmail.com/#t

Cheers,
Enrik


-----BEGIN PGP SIGNATURE-----

iQGzBAEBCAAdFiEEbLyQBMI0qAWiF6l31AjqSkbLPKQFAmYK0eIACgkQ1AjqSkbL
PKTuzwwAhPy9c5/GuTHkaZJhhWcz5VHjbuY9rvywiI3nswEC/Pkav97wIL2IN8jW
9x4+VGJWCv3q/TlNauaD3T6WaPyulTNI9zcFmIY3Adm73+TEQ3OITmZMTJEv3BPC
tgXbs+v0Iuu9G1twpNOrtpQ6aWvwtZJugAN4UOEk+Avx2OIYTc6zoRLTTV+0PMsy
0GlQ3jEQDpB//0ZroP0t9duGtqOIEa6xGfCMOf0ccyyydeVvXjRQOGZ+ZkZ81Egp
fWnc0KRb5gzNAgLa4wzksOtu6sBDtXj1jBcrbqwzOuTfr+KBgebfbalHNExPAVxJ
6DYaZ3yPBL81EaUu/QSGFwOodphtkjGvfkGonvtX/bQOSxXEhwAe4wvWeeE0wncN
um6YVw+QoBKaIxXEV+jtjkelMazAopf6jp6EDEoqmcfPS17oag2Hkg05oooJNSNc
PizbNmYZv6imykUpM8vC9nX54jup9t9MKbNdcMRcU/ReRdhLKm6au4qjWTSxfXXp
ll4euik0
=0GKA
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2024-04-01 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-01 13:39 [PATCH] platform/x86/intel/hid: Ignore power button release in wakeup mode Enrik Berkhan
2024-04-01 15:25 ` Enrik Berkhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.