Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-17 16:41:09 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-17 16:41:17 +0200
commitdf10ac309dc77cdf4740a1228a3c541cf643f0be (patch)
treedfe7e5d19828850adebfec97fa184492a3c26a4c
parent8eead19e4627930a881ba9d923be0deed03601ca (diff)
ACPI: button: reinitialize button state upon resume
(bsc#1051510).
-rw-r--r--patches.fixes/ACPI-button-reinitialize-button-state-upon-resume.patch46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.fixes/ACPI-button-reinitialize-button-state-upon-resume.patch b/patches.fixes/ACPI-button-reinitialize-button-state-upon-resume.patch
new file mode 100644
index 0000000000..d9752fa0cd
--- /dev/null
+++ b/patches.fixes/ACPI-button-reinitialize-button-state-upon-resume.patch
@@ -0,0 +1,46 @@
+From 13e962140be671f31a011543f11477af67a6c33e Mon Sep 17 00:00:00 2001
+From: Zhang Rui <rui.zhang@intel.com>
+Date: Tue, 2 Apr 2019 21:38:32 +0800
+Subject: [PATCH] ACPI: button: reinitialize button state upon resume
+Git-commit: 13e962140be671f31a011543f11477af67a6c33e
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+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>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/acpi/button.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/acpi/button.c
++++ b/drivers/acpi/button.c
+@@ -442,8 +442,11 @@ static int acpi_button_resume(struct dev
+ struct acpi_button *button = acpi_driver_data(device);
+
+ button->suspended = false;
+- if (button->type == ACPI_BUTTON_TYPE_LID)
++ if (button->type == ACPI_BUTTON_TYPE_LID) {
++ button->last_state = !!acpi_lid_evaluate_state(device);
++ button->last_time = ktime_get();
+ acpi_lid_initialize_state(device);
++ }
+ return 0;
+ }
+ #endif
diff --git a/series.conf b/series.conf
index 169f0328bc..442939ec21 100644
--- a/series.conf
+++ b/series.conf
@@ -21842,6 +21842,7 @@
patches.arch/x86-speculation-support-mitigations-cmdline-option.patch
patches.arch/powerpc-speculation-support-mitigations-cmdline-option.patch
patches.arch/s390-speculation-support-mitigations-cmdline-option.patch
+ patches.fixes/ACPI-button-reinitialize-button-state-upon-resume.patch
patches.arch/x86-mce-handle-varying-mca-bank-counts.patch
patches.drivers/hwmon-f71805f-Use-request_muxed_region-for-Super-IO-.patch
patches.drivers/hwmon-pc87427-Use-request_muxed_region-for-Super-IO-.patch