* pm-sleep: Revert "PM / sleep / ACPI: Use the ACPI_FADT_LOW_POWER_S0 flag" * pm-cpufreq: cpufreq: intel_pstate: Fix sysfs limits enforcement for performance policy
Unified · Split
| @@ -35,9 +35,7 @@ only one way to cause the system to go into the Suspend-To-RAM state (write · 34 unmodified lines | ||
| 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 | |
| @@ -674,14 +674,6 @@ static void acpi_sleep_suspend_setup(void) · 673 unmodified lines | ||
| 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); |
| @@ -2005,7 +2005,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) · 2004 unmodified lines | ||
| 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,6 +2048,17 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy) · 35 unmodified lines | ||
| 2047 | 2048 | policy->policy != CPUFREQ_POLICY_PERFORMANCE) |
| 2048 | 2049 | return -EINVAL; |
| 2049 | 2050 | |
| 2051 | + /* When per-CPU limits are used, sysfs limits are not used */ | |
| 2052 | + if (!per_cpu_limits) { | |
| 2053 | + unsigned int max_freq, min_freq; | |
| 2054 | + | |
| 2055 | + max_freq = policy->cpuinfo.max_freq * | |
| 2056 | + limits->max_sysfs_pct / 100; | |
| 2057 | + min_freq = policy->cpuinfo.max_freq * | |
| 2058 | + limits->min_sysfs_pct / 100; | |
| 2059 | + cpufreq_verify_within_limits(policy, min_freq, max_freq); | |
| 2060 | + } | |
| 2061 | + | |
| 2050 | 2062 | return 0; |
| 2051 | 2063 | } |
| 2052 | 2064 | |
| @@ -194,8 +194,6 @@ struct platform_freeze_ops { · 193 unmodified lines | ||
| 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. |
| @@ -46,7 +46,7 @@ static const char * const mem_sleep_labels[] = { · 45 unmodified lines | ||
| 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,7 +168,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops) · 115 unmodified lines | ||
| 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 | |