summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid McFarland <corngood@gmail.com>2024-04-04 08:41:45 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-13 13:10:11 +0200
commit3fe68ad2d356350f8e6d0c3432c10e3c197f5a6f (patch)
treecd8a93a85cce094aa5502e2bfb00c9bece35f49d
parent6be74b1e21f8de4c48af772c2f658b464bfe6145 (diff)
downloadlinux-stable-3fe68ad2d356350f8e6d0c3432c10e3c197f5a6f.tar.gz
linux-stable-3fe68ad2d356350f8e6d0c3432c10e3c197f5a6f.tar.bz2
linux-stable-3fe68ad2d356350f8e6d0c3432c10e3c197f5a6f.zip
platform/x86/intel/hid: Don't wake on 5-button releases
[ Upstream commit 5864e479ca4344f3a5df8074524da24c960f440b ] If, for example, the power button is configured to suspend, holding it and releasing it after the machine has suspended, will wake the machine. Also on some machines, power button release events are sent during hibernation, even if the button wasn't used to hibernate the machine. This causes hibernation to be aborted. Fixes: 0c4cae1bc00d ("PM: hibernate: Avoid missing wakeup events during hibernation") Signed-off-by: David McFarland <corngood@gmail.com> Tested-by: Enrik Berkhan <Enrik.Berkhan@inka.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/878r1tpd6u.fsf_-_@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/platform/x86/intel/hid.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c
index 7457ca2b27a6..9ffbdc988fe5 100644
--- a/drivers/platform/x86/intel/hid.c
+++ b/drivers/platform/x86/intel/hid.c
@@ -504,6 +504,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
struct platform_device *device = context;
struct intel_hid_priv *priv = dev_get_drvdata(&device->dev);
unsigned long long ev_index;
+ struct key_entry *ke;
int err;
/*
@@ -545,11 +546,15 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
if (event == 0xc0 || !priv->array)
return;
- if (!sparse_keymap_entry_from_scancode(priv->array, event)) {
+ ke = sparse_keymap_entry_from_scancode(priv->array, event);
+ if (!ke) {
dev_info(&device->dev, "unknown event 0x%x\n", event);
return;
}
+ if (ke->type == KE_IGNORE)
+ return;
+
wakeup:
pm_wakeup_hard_event(&device->dev);