Merge tag 'pm-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
"These fix two regressions introduced recently, one by reverting the
problematic commit and one by fixing up the behavior in an overlooked
case.

Specifics:

- Revert the recent change that caused suspend-to-idle to be used as
the default suspend method on systems where it is indicated to be
efficient by the ACPI tables, as that turned out to be premature
and introduced suspend regressions on some systems with missing
power management support in device drivers (Rafael Wysocki).

- Fix up the intel_pstate driver to take changes of the global limits
via sysfs correctly when the performance policy is used which has
been broken by a recent change in it (Srinivas Pandruvada)"

* tag 'pm-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: intel_pstate: Fix sysfs limits enforcement for performance policy
Revert "PM / sleep / ACPI: Use the ACPI_FADT_LOW_POWER_S0 flag"

+16 -16
+1 -3
Documentation/power/states.txt
··· 35 35 The default suspend mode (ie. the one to be used without writing anything into 36 36 /sys/power/mem_sleep) is either "deep" (if Suspend-To-RAM is supported) or 37 37 "s2idle", but it can be overridden by the value of the "mem_sleep_default" 38 - parameter in the kernel command line. On some ACPI-based systems, depending on 39 - the information in the FADT, the default may be "s2idle" even if Suspend-To-RAM 40 - is supported. 38 + parameter in the kernel command line. 41 39 42 40 The properties of all of the sleep states are described below. 43 41
-8
drivers/acpi/sleep.c
··· 674 674 if (acpi_sleep_state_supported(i)) 675 675 sleep_states[i] = 1; 676 676 677 - /* 678 - * Use suspend-to-idle by default if ACPI_FADT_LOW_POWER_S0 is set and 679 - * the default suspend mode was not selected from the command line. 680 - */ 681 - if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0 && 682 - mem_sleep_default > PM_SUSPEND_MEM) 683 - mem_sleep_default = PM_SUSPEND_FREEZE; 684 - 685 677 suspend_set_ops(old_suspend_ordering ? 686 678 &acpi_suspend_ops_old : &acpi_suspend_ops); 687 679 freeze_set_ops(&acpi_freeze_ops);
+13 -1
drivers/cpufreq/intel_pstate.c
··· 2005 2005 limits = &performance_limits; 2006 2006 perf_limits = limits; 2007 2007 } 2008 - if (policy->max >= policy->cpuinfo.max_freq) { 2008 + if (policy->max >= policy->cpuinfo.max_freq && 2009 + !limits->no_turbo) { 2009 2010 pr_debug("set performance\n"); 2010 2011 intel_pstate_set_performance_limits(perf_limits); 2011 2012 goto out; ··· 2047 2046 if (policy->policy != CPUFREQ_POLICY_POWERSAVE && 2048 2047 policy->policy != CPUFREQ_POLICY_PERFORMANCE) 2049 2048 return -EINVAL; 2049 + 2050 + /* When per-CPU limits are used, sysfs limits are not used */ 2051 + if (!per_cpu_limits) { 2052 + unsigned int max_freq, min_freq; 2053 + 2054 + max_freq = policy->cpuinfo.max_freq * 2055 + limits->max_sysfs_pct / 100; 2056 + min_freq = policy->cpuinfo.max_freq * 2057 + limits->min_sysfs_pct / 100; 2058 + cpufreq_verify_within_limits(policy, min_freq, max_freq); 2059 + } 2050 2060 2051 2061 return 0; 2052 2062 }
-2
include/linux/suspend.h
··· 194 194 }; 195 195 196 196 #ifdef CONFIG_SUSPEND 197 - extern suspend_state_t mem_sleep_default; 198 - 199 197 /** 200 198 * suspend_set_ops - set platform dependent suspend operations 201 199 * @ops: The new suspend operations to set.
+2 -2
kernel/power/suspend.c
··· 46 46 const char *mem_sleep_states[PM_SUSPEND_MAX]; 47 47 48 48 suspend_state_t mem_sleep_current = PM_SUSPEND_FREEZE; 49 - suspend_state_t mem_sleep_default = PM_SUSPEND_MAX; 49 + static suspend_state_t mem_sleep_default = PM_SUSPEND_MEM; 50 50 51 51 unsigned int pm_suspend_global_flags; 52 52 EXPORT_SYMBOL_GPL(pm_suspend_global_flags); ··· 168 168 } 169 169 if (valid_state(PM_SUSPEND_MEM)) { 170 170 mem_sleep_states[PM_SUSPEND_MEM] = mem_sleep_labels[PM_SUSPEND_MEM]; 171 - if (mem_sleep_default >= PM_SUSPEND_MEM) 171 + if (mem_sleep_default == PM_SUSPEND_MEM) 172 172 mem_sleep_current = PM_SUSPEND_MEM; 173 173 } 174 174