Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+32 -9
+11 -7
drivers/acpi/acpi_lpss.c
··· 22 22 #include <linux/pm_domain.h> 23 23 #include <linux/pm_runtime.h> 24 24 #include <linux/pwm.h> 25 + #include <linux/suspend.h> 25 26 #include <linux/delay.h> 26 27 27 28 #include "internal.h" ··· 947 946 mutex_unlock(&lpss_iosf_mutex); 948 947 } 949 948 950 - static int acpi_lpss_suspend(struct device *dev, bool wakeup) 949 + static int acpi_lpss_suspend(struct device *dev, bool runtime) 951 950 { 952 951 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 952 + bool wakeup = runtime || device_may_wakeup(dev); 953 953 int ret; 954 954 955 955 if (pdata->dev_desc->flags & LPSS_SAVE_CTX) ··· 963 961 * wrong status for devices being about to be powered off. See 964 962 * lpss_iosf_enter_d3_state() for further information. 965 963 */ 966 - if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) 964 + if ((runtime || !pm_suspend_via_firmware()) && 965 + lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) 967 966 lpss_iosf_enter_d3_state(); 968 967 969 968 return ret; 970 969 } 971 970 972 - static int acpi_lpss_resume(struct device *dev) 971 + static int acpi_lpss_resume(struct device *dev, bool runtime) 973 972 { 974 973 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 975 974 int ret; ··· 979 976 * This call is kept first to be in symmetry with 980 977 * acpi_lpss_runtime_suspend() one. 981 978 */ 982 - if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) 979 + if ((runtime || !pm_resume_via_firmware()) && 980 + lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) 983 981 lpss_iosf_exit_d3_state(); 984 982 985 983 ret = acpi_dev_resume(dev); ··· 1004 1000 return 0; 1005 1001 1006 1002 ret = pm_generic_suspend_late(dev); 1007 - return ret ? ret : acpi_lpss_suspend(dev, device_may_wakeup(dev)); 1003 + return ret ? ret : acpi_lpss_suspend(dev, false); 1008 1004 } 1009 1005 1010 1006 static int acpi_lpss_resume_early(struct device *dev) 1011 1007 { 1012 - int ret = acpi_lpss_resume(dev); 1008 + int ret = acpi_lpss_resume(dev, false); 1013 1009 1014 1010 return ret ? ret : pm_generic_resume_early(dev); 1015 1011 } ··· 1024 1020 1025 1021 static int acpi_lpss_runtime_resume(struct device *dev) 1026 1022 { 1027 - int ret = acpi_lpss_resume(dev); 1023 + int ret = acpi_lpss_resume(dev, true); 1028 1024 1029 1025 return ret ? ret : pm_generic_runtime_resume(dev); 1030 1026 }
+20
drivers/acpi/ec.c
··· 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 2051 int __init acpi_ec_init(void) 2041 2052 { 2042 2053 int result; ··· 2057 2046 result = acpi_ec_query_init(); 2058 2047 if (result) 2059 2048 return result; 2049 + 2050 + /* 2051 + * Disable EC wakeup on following systems to prevent periodic 2052 + * wakeup from EC GPE. 2053 + */ 2054 + if (dmi_check_system(acpi_ec_no_wakeup)) { 2055 + ec_no_wakeup = true; 2056 + pr_debug("Disabling EC wakeup on suspend-to-idle\n"); 2057 + } 2060 2058 2061 2059 /* Drivers must be started after acpi_ec_query_init() */ 2062 2060 dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver);
+1 -2
include/acpi/processor.h
··· 309 309 { 310 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 313 int event_flag) 314 314 { 315 315 static unsigned int printout = 1; ··· 320 320 "Consider compiling CPUfreq support into your kernel.\n"); 321 321 printout = 0; 322 322 } 323 - return 0; 324 323 } 325 324 static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) 326 325 {