Skip to content

Commit

Permalink
cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setp…
Browse files Browse the repository at this point in the history
…olicy drivers

When configuring a default governor (via CONFIG_CPU_FREQ_DEFAULT_*) with the
intel_pstate driver, the desired default policy is not properly set. For
example, setting 'CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE' ends up with the
'powersave' policy being set.

Fix by configuring the correct default policy, if either 'powersave' or
'performance' are requested. Otherwise, fallback to what the driver originally
set via its 'init' routine.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Jason Baron authored and Rafael J. Wysocki committed Dec 21, 2013
1 parent 42f921a commit a27a9ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,12 @@ static void cpufreq_init_policy(struct cpufreq_policy *policy)
int ret = 0;

memcpy(&new_policy, policy, sizeof(*policy));

/* Use the default policy if its valid. */
if (cpufreq_driver->setpolicy)
cpufreq_parse_governor(policy->governor->name,
&new_policy.policy, NULL);

/* assure that the starting sequence is run in cpufreq_set_policy */
policy->governor = NULL;

Expand Down

0 comments on commit a27a9ab

Please sign in to comment.