]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit1105b0c1426677f44c8b8c48a1e5bafbf20a64fd
treea1a8876a21a115d9d47a27edee8f0f6de3df3967
parenta79a9b1c42669b1eb687a6fe5f5f7b23fb95a4a2
ACPI: button: reinitialize button state upon resume

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 13e962140be671f31a011543f11477af67a6c33e ]

With commit dfa46c50f65b ("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: dfa46c50f65b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/acpi/button.c