Skip to content

Commit

Permalink
cpufreq / intel_pstate: Do not load on VM that does not report max P …
Browse files Browse the repository at this point in the history
…state.

It seems some VMs support the P state MSRs but return zeros. Fail
gracefully if we are running in this environment.

References: https://bugzilla.redhat.com/show_bug.cgi?id=916833
Reported-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Dirk Brandewie authored and Rafael J. Wysocki committed Mar 6, 2013
1 parent 907cc90 commit d3929b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)

cpu = all_cpu_data[policy->cpu];

if (!policy->cpuinfo.max_freq)
return -ENODEV;

intel_pstate_get_min_max(cpu, &min, &max);

limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
Expand Down

0 comments on commit d3929b8

Please sign in to comment.