diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-21 17:00:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-21 17:00:13 -0400 |
commit | f43fc5a0c11233229ec584c00636688e79f9a2c8 (patch) | |
tree | cc8ac1db5aed8094e4dbc5049af99243ba3e0119 | |
parent | 26c92a38cec99ee7b657901ff64bd01a96a2fb22 (diff) | |
parent | e50f182c9094f95ecfd52a7f33e7e7320e85eb49 (diff) |
Merge tag 'acpi-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki:
"These fix a suspend/resume regression in the ACPI driver for Intel
SoCs (LPSS), add a new system wakeup quirk to the ACPI EC driver and
fix an inline stub of a function in the ACPI processor driver that
diverged from the original.
Specifics:
- Fix a suspend/resume regression in the ACPI driver for Intel SoCs
(LPSS) to make it work on systems where some power management
quirks should only be applied for runtime PM and suspend-to-idle
and not for suspend-to-RAM (Rafael Wysocki).
- Add a system wakeup quirk for Thinkpad X1 Carbon 6th to the ACPI EC
driver to avoid drainig battery too fast while suspended to idle on
those systems (Mika Westerberg).
- Fix an inline stub of acpi_processor_ppc_has_changed() to match the
original function definition (Brian Norris)"
* tag 'acpi-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / processor: Finish making acpi_processor_ppc_has_changed() void
ACPI / EC: Use ec_no_wakeup on Thinkpad X1 Carbon 6th
ACPI / LPSS: Avoid PM quirks on suspend and resume from S3
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 18 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 20 | ||||
-rw-r--r-- | include/acpi/processor.h | 3 |
3 files changed, 32 insertions, 9 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 38a286975c31..f8fecfec5df9 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/pm_domain.h> | 22 | #include <linux/pm_domain.h> |
23 | #include <linux/pm_runtime.h> | 23 | #include <linux/pm_runtime.h> |
24 | #include <linux/pwm.h> | 24 | #include <linux/pwm.h> |
25 | #include <linux/suspend.h> | ||
25 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
26 | 27 | ||
27 | #include "internal.h" | 28 | #include "internal.h" |
@@ -946,9 +947,10 @@ static void lpss_iosf_exit_d3_state(void) | |||
946 | mutex_unlock(&lpss_iosf_mutex); | 947 | mutex_unlock(&lpss_iosf_mutex); |
947 | } | 948 | } |
948 | 949 | ||
949 | static int acpi_lpss_suspend(struct device *dev, bool wakeup) | 950 | static int acpi_lpss_suspend(struct device *dev, bool runtime) |
950 | { | 951 | { |
951 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); | 952 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); |
953 | bool wakeup = runtime || device_may_wakeup(dev); | ||
952 | int ret; | 954 | int ret; |
953 | 955 | ||
954 | if (pdata->dev_desc->flags & LPSS_SAVE_CTX) | 956 | if (pdata->dev_desc->flags & LPSS_SAVE_CTX) |
@@ -961,13 +963,14 @@ static int acpi_lpss_suspend(struct device *dev, bool wakeup) | |||
961 | * wrong status for devices being about to be powered off. See | 963 | * wrong status for devices being about to be powered off. See |
962 | * lpss_iosf_enter_d3_state() for further information. | 964 | * lpss_iosf_enter_d3_state() for further information. |
963 | */ | 965 | */ |
964 | if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | 966 | if ((runtime || !pm_suspend_via_firmware()) && |
967 | lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | ||
965 | lpss_iosf_enter_d3_state(); | 968 | lpss_iosf_enter_d3_state(); |
966 | 969 | ||
967 | return ret; | 970 | return ret; |
968 | } | 971 | } |
969 | 972 | ||
970 | static int acpi_lpss_resume(struct device *dev) | 973 | static int acpi_lpss_resume(struct device *dev, bool runtime) |
971 | { | 974 | { |
972 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); | 975 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); |
973 | int ret; | 976 | int ret; |
@@ -976,7 +979,8 @@ static int acpi_lpss_resume(struct device *dev) | |||
976 | * This call is kept first to be in symmetry with | 979 | * This call is kept first to be in symmetry with |
977 | * acpi_lpss_runtime_suspend() one. | 980 | * acpi_lpss_runtime_suspend() one. |
978 | */ | 981 | */ |
979 | if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | 982 | if ((runtime || !pm_resume_via_firmware()) && |
983 | lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | ||
980 | lpss_iosf_exit_d3_state(); | 984 | lpss_iosf_exit_d3_state(); |
981 | 985 | ||
982 | ret = acpi_dev_resume(dev); | 986 | ret = acpi_dev_resume(dev); |
@@ -1000,12 +1004,12 @@ static int acpi_lpss_suspend_late(struct device *dev) | |||
1000 | return 0; | 1004 | return 0; |
1001 | 1005 | ||
1002 | ret = pm_generic_suspend_late(dev); | 1006 | ret = pm_generic_suspend_late(dev); |
1003 | return ret ? ret : acpi_lpss_suspend(dev, device_may_wakeup(dev)); | 1007 | return ret ? ret : acpi_lpss_suspend(dev, false); |
1004 | } | 1008 | } |
1005 | 1009 | ||
1006 | static int acpi_lpss_resume_early(struct device *dev) | 1010 | static int acpi_lpss_resume_early(struct device *dev) |
1007 | { | 1011 | { |
1008 | int ret = acpi_lpss_resume(dev); | 1012 | int ret = acpi_lpss_resume(dev, false); |
1009 | 1013 | ||
1010 | return ret ? ret : pm_generic_resume_early(dev); | 1014 | return ret ? ret : pm_generic_resume_early(dev); |
1011 | } | 1015 | } |
@@ -1020,7 +1024,7 @@ static int acpi_lpss_runtime_suspend(struct device *dev) | |||
1020 | 1024 | ||
1021 | static int acpi_lpss_runtime_resume(struct device *dev) | 1025 | static int acpi_lpss_runtime_resume(struct device *dev) |
1022 | { | 1026 | { |
1023 | int ret = acpi_lpss_resume(dev); | 1027 | int ret = acpi_lpss_resume(dev, true); |
1024 | 1028 | ||
1025 | return ret ? ret : pm_generic_runtime_resume(dev); | 1029 | return ret ? ret : pm_generic_runtime_resume(dev); |
1026 | } | 1030 | } |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index bb94cf0731fe..442a9e24f439 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -2037,6 +2037,17 @@ static inline void acpi_ec_query_exit(void) | |||
2037 | } | 2037 | } |
2038 | } | 2038 | } |
2039 | 2039 | ||
2040 | static const struct dmi_system_id acpi_ec_no_wakeup[] = { | ||
2041 | { | ||
2042 | .ident = "Thinkpad X1 Carbon 6th", | ||
2043 | .matches = { | ||
2044 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
2045 | DMI_MATCH(DMI_PRODUCT_NAME, "20KGS3JF01"), | ||
2046 | }, | ||
2047 | }, | ||
2048 | { }, | ||
2049 | }; | ||
2050 | |||
2040 | int __init acpi_ec_init(void) | 2051 | int __init acpi_ec_init(void) |
2041 | { | 2052 | { |
2042 | int result; | 2053 | int result; |
@@ -2047,6 +2058,15 @@ int __init acpi_ec_init(void) | |||
2047 | if (result) | 2058 | if (result) |
2048 | return result; | 2059 | return result; |
2049 | 2060 | ||
2061 | /* | ||
2062 | * Disable EC wakeup on following systems to prevent periodic | ||
2063 | * wakeup from EC GPE. | ||
2064 | */ | ||
2065 | if (dmi_check_system(acpi_ec_no_wakeup)) { | ||
2066 | ec_no_wakeup = true; | ||
2067 | pr_debug("Disabling EC wakeup on suspend-to-idle\n"); | ||
2068 | } | ||
2069 | |||
2050 | /* Drivers must be started after acpi_ec_query_init() */ | 2070 | /* Drivers must be started after acpi_ec_query_init() */ |
2051 | dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver); | 2071 | dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver); |
2052 | /* | 2072 | /* |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 40a916efd7c0..1194a4c78d55 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -309,7 +309,7 @@ static inline void acpi_processor_ppc_exit(void) | |||
309 | { | 309 | { |
310 | return; | 310 | return; |
311 | } | 311 | } |
312 | static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr, | 312 | static inline void acpi_processor_ppc_has_changed(struct acpi_processor *pr, |
313 | int event_flag) | 313 | int event_flag) |
314 | { | 314 | { |
315 | static unsigned int printout = 1; | 315 | static unsigned int printout = 1; |
@@ -320,7 +320,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr, | |||
320 | "Consider compiling CPUfreq support into your kernel.\n"); | 320 | "Consider compiling CPUfreq support into your kernel.\n"); |
321 | printout = 0; | 321 | printout = 0; |
322 | } | 322 | } |
323 | return 0; | ||
324 | } | 323 | } |
325 | static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | 324 | static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) |
326 | { | 325 | { |