summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2019-03-25 09:04:40 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-03 06:27:34 +0200
commit7466a2abe75765daf7d00ada675d2f082f5ece2c (patch)
tree7945aaf01e8c1743c77accb683fa3540df2cf881
parent0dcb45879a5f6bbb412e232adf2d29a98119c889 (diff)
downloadtalos-obmc-linux-7466a2abe75765daf7d00ada675d2f082f5ece2c.tar.gz
talos-obmc-linux-7466a2abe75765daf7d00ada675d2f082f5ece2c.zip
cpufreq: intel_pstate: Also use CPPC nominal_perf for base_frequency
commit 92a3e426ec06e72b1c363179c79d30712447ff76 upstream. The ACPI specification states that if the "Guaranteed Performance Register" is not implemented, the OSPM assumes guaranteed performance to always be equal to nominal performance. So for invalid or unimplemented guaranteed performance register, use nominal performance as guaranteed performance. This change will fall back to nominal_perf when guranteed_perf is invalid. If nominal_perf is also invalid or not present, fall back to the existing implementation, which is to read from HWP Capabilities MSR. Fixes: 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency attribute") Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: 4.20+ <stable@vger.kernel.org> # 4.20+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/cpufreq/intel_pstate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 5ab6a4fe93aa..a579ca4552df 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -383,7 +383,10 @@ static int intel_pstate_get_cppc_guranteed(int cpu)
if (ret)
return ret;
- return cppc_perf.guaranteed_perf;
+ if (cppc_perf.guaranteed_perf)
+ return cppc_perf.guaranteed_perf;
+
+ return cppc_perf.nominal_perf;
}
#else /* CONFIG_ACPI_CPPC_LIB */
OpenPOWER on IntegriCloud