diff mbox series

platform/x86/intel/hid: Ignore power button release in wakeup mode

Message ID 20240401133919.4304-1-Enrik.Berkhan@inka.de (mailing list archive)
State Superseded, archived
Headers show
Series platform/x86/intel/hid: Ignore power button release in wakeup mode | expand

Commit Message

Enrik Berkhan April 1, 2024, 1:39 p.m. UTC
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(+)

Comments

Enrik Berkhan April 1, 2024, 3:25 p.m. UTC | #1
-----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-----
diff mbox series

Patch

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