Commit 66561277 authored by Zhang Rui's avatar Zhang Rui Committed by Xie XiuQi
Browse files

ACPI: button: reinitialize button state upon resume



mainline inclusion
from mainline-5.1-rc4
commit 13e96214
category: bugfix
bugzilla: 14744
CVE: NA

-------------------------------------------------

With commit dfa46c50 ("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: dfa46c50 ("ACPI / button: Fix an issue in button.lid_init_state=ignore mode")
Reported-and-tested-by: default avatarZhao Lijian <lijian.zhao@intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarYao Hongbo <yaohongbo@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent dc9cb037
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment