]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.8.6/platform-x86-intel-hid-don-t-wake-on-5-button-releas.patch
Linux 6.8.6
[thirdparty/kernel/stable-queue.git] / releases / 6.8.6 / platform-x86-intel-hid-don-t-wake-on-5-button-releas.patch
1 From 54aae6802f6cee97a0d2f2c0b41a01022eee3ef3 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 4 Apr 2024 08:41:45 -0300
4 Subject: platform/x86/intel/hid: Don't wake on 5-button releases
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: David McFarland <corngood@gmail.com>
10
11 [ Upstream commit 5864e479ca4344f3a5df8074524da24c960f440b ]
12
13 If, for example, the power button is configured to suspend, holding it
14 and releasing it after the machine has suspended, will wake the machine.
15
16 Also on some machines, power button release events are sent during
17 hibernation, even if the button wasn't used to hibernate the machine.
18 This causes hibernation to be aborted.
19
20 Fixes: 0c4cae1bc00d ("PM: hibernate: Avoid missing wakeup events during hibernation")
21 Signed-off-by: David McFarland <corngood@gmail.com>
22 Tested-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
23 Reviewed-by: Hans de Goede <hdegoede@redhat.com>
24 Link: https://lore.kernel.org/r/878r1tpd6u.fsf_-_@gmail.com
25 Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
26 Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
27 Signed-off-by: Sasha Levin <sashal@kernel.org>
28 ---
29 drivers/platform/x86/intel/hid.c | 7 ++++++-
30 1 file changed, 6 insertions(+), 1 deletion(-)
31
32 diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c
33 index 7457ca2b27a60..9ffbdc988fe50 100644
34 --- a/drivers/platform/x86/intel/hid.c
35 +++ b/drivers/platform/x86/intel/hid.c
36 @@ -504,6 +504,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
37 struct platform_device *device = context;
38 struct intel_hid_priv *priv = dev_get_drvdata(&device->dev);
39 unsigned long long ev_index;
40 + struct key_entry *ke;
41 int err;
42
43 /*
44 @@ -545,11 +546,15 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
45 if (event == 0xc0 || !priv->array)
46 return;
47
48 - if (!sparse_keymap_entry_from_scancode(priv->array, event)) {
49 + ke = sparse_keymap_entry_from_scancode(priv->array, event);
50 + if (!ke) {
51 dev_info(&device->dev, "unknown event 0x%x\n", event);
52 return;
53 }
54
55 + if (ke->type == KE_IGNORE)
56 + return;
57 +
58 wakeup:
59 pm_wakeup_hard_event(&device->dev);
60
61 --
62 2.43.0
63