]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: button: reinitialize button state upon resume
authorZhang Rui <rui.zhang@intel.com>
Tue, 2 Apr 2019 13:38:32 +0000 (21:38 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 12 Apr 2019 08:29:01 +0000 (10:29 +0200)
commit1283252ac66232a05647c16a0d36aaaf77adc1f2
treeb475dbdcbdd69df9e7f0c194e532ced22c7dc068
parent68d7df48a4a5ca87071fc7a70814a96c28168e78
ACPI: button: reinitialize button state upon resume

With commit d79cb7410d20 ("ACPI / button: Fix an issue in
button.lid_init_state=ignore mode"), the lid device is considered to be
not compliant to SW_LID if the Lid state is unchanged when updating it.

This is not wrong, but we overlooked the resume case, where Lid state is
updated unconditionally in the button driver .resume() callback. And this
results in warning message "ACPI: button: The lid device is not compliant
to  SW_LID." after resume, if the machine is suspended with Lid opened and
then resumed with Lid opened.

Fix this by flushing the cached lid state before updating the Lid device
in .resume() callback.

Fixes: d79cb7410d20 ("ACPI / button: Fix an issue in button.lid_init_state=ignore mode")
Reported-and-tested-by: Zhao Lijian <lijian.zhao@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/button.c