cpufreq: intel_pstate: get P1 from TAR when available
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 14 Oct 2015 23:11:59 +0000 (16:11 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Oct 2015 23:53:18 +0000 (01:53 +0200)
commit6a35fc2d6c22bafe45117cdc5d8cee332244edbb
treefa4883706d74d69fd6759a68b9502245ade2ba1a
parente625742f9c6e5d01b5c46efcc2870893735badf3
cpufreq: intel_pstate: get P1 from TAR when available

After Ivybridge, the max non turbo ratio obtained from platform info msr
is not always guaranteed P1 on client platforms. The max non turbo
activation ratio (TAR), determines the max for the current level of TDP.
The ratio in platform info is physical max. The TAR MSR can be locked,
so updating this value is not possible on all platforms.
This change gets this ratio from MSR TURBO_ACTIVATION_RATIO if
available,
but also do some sanity checking to make sure that this value is
correct.
The sanity check involves reading the TDP ratio for the current tdp
control value when platform has configurable TDP present and matching
TAC
with this.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/x86/include/asm/msr-index.h
drivers/cpufreq/intel_pstate.c