Commit ff7e593c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'pm-sleep' and 'pm-cpufreq'

* 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
...@@ -35,9 +35,7 @@ only one way to cause the system to go into the Suspend-To-RAM state (write ...@@ -35,9 +35,7 @@ only one way to cause the system to go into the Suspend-To-RAM state (write
The default suspend mode (ie. the one to be used without writing anything into The default suspend mode (ie. the one to be used without writing anything into
/sys/power/mem_sleep) is either "deep" (if Suspend-To-RAM is supported) or /sys/power/mem_sleep) is either "deep" (if Suspend-To-RAM is supported) or
"s2idle", but it can be overridden by the value of the "mem_sleep_default" "s2idle", but it can be overridden by the value of the "mem_sleep_default"
parameter in the kernel command line. On some ACPI-based systems, depending on parameter in the kernel command line.
the information in the FADT, the default may be "s2idle" even if Suspend-To-RAM
is supported.
The properties of all of the sleep states are described below. The properties of all of the sleep states are described below.
......
...@@ -674,14 +674,6 @@ static void acpi_sleep_suspend_setup(void) ...@@ -674,14 +674,6 @@ static void acpi_sleep_suspend_setup(void)
if (acpi_sleep_state_supported(i)) if (acpi_sleep_state_supported(i))
sleep_states[i] = 1; sleep_states[i] = 1;
/*
* Use suspend-to-idle by default if ACPI_FADT_LOW_POWER_S0 is set and
* the default suspend mode was not selected from the command line.
*/
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0 &&
mem_sleep_default > PM_SUSPEND_MEM)
mem_sleep_default = PM_SUSPEND_FREEZE;
suspend_set_ops(old_suspend_ordering ? suspend_set_ops(old_suspend_ordering ?
&acpi_suspend_ops_old : &acpi_suspend_ops); &acpi_suspend_ops_old : &acpi_suspend_ops);
freeze_set_ops(&acpi_freeze_ops); freeze_set_ops(&acpi_freeze_ops);
......
...@@ -2005,7 +2005,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) ...@@ -2005,7 +2005,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
limits = &performance_limits; limits = &performance_limits;
perf_limits = limits; perf_limits = limits;
} }
if (policy->max >= policy->cpuinfo.max_freq) { if (policy->max >= policy->cpuinfo.max_freq &&
!limits->no_turbo) {
pr_debug("set performance\n"); pr_debug("set performance\n");
intel_pstate_set_performance_limits(perf_limits); intel_pstate_set_performance_limits(perf_limits);
goto out; goto out;
...@@ -2047,6 +2048,17 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy) ...@@ -2047,6 +2048,17 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
policy->policy != CPUFREQ_POLICY_PERFORMANCE) policy->policy != CPUFREQ_POLICY_PERFORMANCE)
return -EINVAL; return -EINVAL;
/* When per-CPU limits are used, sysfs limits are not used */
if (!per_cpu_limits) {
unsigned int max_freq, min_freq;
max_freq = policy->cpuinfo.max_freq *
limits->max_sysfs_pct / 100;
min_freq = policy->cpuinfo.max_freq *
limits->min_sysfs_pct / 100;
cpufreq_verify_within_limits(policy, min_freq, max_freq);
}
return 0; return 0;
} }
......
...@@ -194,8 +194,6 @@ struct platform_freeze_ops { ...@@ -194,8 +194,6 @@ struct platform_freeze_ops {
}; };
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
extern suspend_state_t mem_sleep_default;
/** /**
* suspend_set_ops - set platform dependent suspend operations * suspend_set_ops - set platform dependent suspend operations
* @ops: The new suspend operations to set. * @ops: The new suspend operations to set.
......
...@@ -46,7 +46,7 @@ static const char * const mem_sleep_labels[] = { ...@@ -46,7 +46,7 @@ static const char * const mem_sleep_labels[] = {
const char *mem_sleep_states[PM_SUSPEND_MAX]; const char *mem_sleep_states[PM_SUSPEND_MAX];
suspend_state_t mem_sleep_current = PM_SUSPEND_FREEZE; suspend_state_t mem_sleep_current = PM_SUSPEND_FREEZE;
suspend_state_t mem_sleep_default = PM_SUSPEND_MAX; static suspend_state_t mem_sleep_default = PM_SUSPEND_MEM;
unsigned int pm_suspend_global_flags; unsigned int pm_suspend_global_flags;
EXPORT_SYMBOL_GPL(pm_suspend_global_flags); EXPORT_SYMBOL_GPL(pm_suspend_global_flags);
...@@ -168,7 +168,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops) ...@@ -168,7 +168,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
} }
if (valid_state(PM_SUSPEND_MEM)) { if (valid_state(PM_SUSPEND_MEM)) {
mem_sleep_states[PM_SUSPEND_MEM] = mem_sleep_labels[PM_SUSPEND_MEM]; mem_sleep_states[PM_SUSPEND_MEM] = mem_sleep_labels[PM_SUSPEND_MEM];
if (mem_sleep_default >= PM_SUSPEND_MEM) if (mem_sleep_default == PM_SUSPEND_MEM)
mem_sleep_current = PM_SUSPEND_MEM; mem_sleep_current = PM_SUSPEND_MEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment