]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ACPI / button: increment wakeup count only when notified
authorRavi Chandra Sadineni <ravisadineni@chromium.org>
Wed, 27 Jun 2018 17:55:02 +0000 (10:55 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:41 +0000 (19:51 -0600)
commit15022c65bb5bb8318e88f7776c37d7d46ae03eb7
tree59a278131aa6fe0931d15ae1768ac30248014096
parent949f194e69b1bdd2f15eaf7af8286b6c822a0f54
ACPI / button: increment wakeup count only when notified

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 7c058c7c74b3dbeb7d157c273959f87faf710350 ]

Because acpi_lid_initialize_state() is called on every system
resume and it triggers acpi_lid_notify_state() which invokes
acpi_pm_wakeup_event() for the lid device, the lid's wakeup count is
incremented even if the lid was not the source of the event that woke up
the system. That behavior confuses user space deamons using
wakeup_count to identify the potential system wakeup source. To avoid
the confusion, only trigger acpi_pm_wakeup_event() in the
acpi_button_notify() path and don't do that in the
acpi_lid_initialize_state() path.

Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/acpi/button.c