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)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 Jul 2018 11:17:13 +0000 (13:17 +0200)
commit7c058c7c74b3dbeb7d157c273959f87faf710350
tree99076673b9c7cf58b833bbbead23d12acde2cc91
parent021c91791a5e7e85c567452f1be3e4c2c6cb6063
ACPI / button: increment wakeup count only when notified

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>
drivers/acpi/button.c