summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/intel_pstate.c
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.brandewie@gmail.com>2013-03-05 14:15:26 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-06 23:40:11 +0100
commitd3929b832833db870af72479666fa4e4d043e02e (patch)
tree69f897201f80becc05d9a13b3a53a198b96b3ec4 /drivers/cpufreq/intel_pstate.c
parent907cc908108b16ae87b7165be992511c968159f0 (diff)
downloadlwn-d3929b832833db870af72479666fa4e4d043e02e.tar.gz
lwn-d3929b832833db870af72479666fa4e4d043e02e.zip
cpufreq / intel_pstate: Do not load on VM that does not report max P 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>
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r--drivers/cpufreq/intel_pstate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 46a23b65dfc8..f6dd1e761129 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -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;