Skip to content

Commit 5864e47

Browse files
corngoodij-intel
authored andcommitted
platform/x86/intel/hid: Don't wake on 5-button releases
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: 0c4cae1 ("PM: hibernate: Avoid missing wakeup events during hibernation") Signed-off-by: David McFarland <[email protected]> Tested-by: Enrik Berkhan <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent b45d0d0 commit 5864e47

File tree

1 file changed

+6
-1
lines changed
  • drivers/platform/x86/intel

1 file changed

+6
-1
lines changed

drivers/platform/x86/intel/hid.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
504504
struct platform_device *device = context;
505505
struct intel_hid_priv *priv = dev_get_drvdata(&device->dev);
506506
unsigned long long ev_index;
507+
struct key_entry *ke;
507508
int err;
508509

509510
/*
@@ -545,11 +546,15 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
545546
if (event == 0xc0 || !priv->array)
546547
return;
547548

548-
if (!sparse_keymap_entry_from_scancode(priv->array, event)) {
549+
ke = sparse_keymap_entry_from_scancode(priv->array, event);
550+
if (!ke) {
549551
dev_info(&device->dev, "unknown event 0x%x\n", event);
550552
return;
551553
}
552554

555+
if (ke->type == KE_IGNORE)
556+
return;
557+
553558
wakeup:
554559
pm_wakeup_hard_event(&device->dev);
555560

0 commit comments

Comments
 (0)