aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/intel_pstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r--drivers/cpufreq/intel_pstate.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index ee367e9b7d2e..fe9dc17ea873 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -372,26 +372,9 @@ static bool intel_pstate_get_ppc_enable_status(void)
372 return acpi_ppc; 372 return acpi_ppc;
373} 373}
374 374
375/*
376 * The max target pstate ratio is a 8 bit value in both PLATFORM_INFO MSR and
377 * in TURBO_RATIO_LIMIT MSR, which pstate driver stores in max_pstate and
378 * max_turbo_pstate fields. The PERF_CTL MSR contains 16 bit value for P state
379 * ratio, out of it only high 8 bits are used. For example 0x1700 is setting
380 * target ratio 0x17. The _PSS control value stores in a format which can be
381 * directly written to PERF_CTL MSR. But in intel_pstate driver this shift
382 * occurs during write to PERF_CTL (E.g. for cores core_set_pstate()).
383 * This function converts the _PSS control value to intel pstate driver format
384 * for comparison and assignment.
385 */
386static int convert_to_native_pstate_format(struct cpudata *cpu, int index)
387{
388 return cpu->acpi_perf_data.states[index].control >> 8;
389}
390
391static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy) 375static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy)
392{ 376{
393 struct cpudata *cpu; 377 struct cpudata *cpu;
394 int turbo_pss_ctl;
395 int ret; 378 int ret;
396 int i; 379 int i;
397 380
@@ -441,11 +424,10 @@ static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy)
441 * max frequency, which will cause a reduced performance as 424 * max frequency, which will cause a reduced performance as
442 * this driver uses real max turbo frequency as the max 425 * this driver uses real max turbo frequency as the max
443 * frequency. So correct this frequency in _PSS table to 426 * frequency. So correct this frequency in _PSS table to
444 * correct max turbo frequency based on the turbo ratio. 427 * correct max turbo frequency based on the turbo state.
445 * Also need to convert to MHz as _PSS freq is in MHz. 428 * Also need to convert to MHz as _PSS freq is in MHz.
446 */ 429 */
447 turbo_pss_ctl = convert_to_native_pstate_format(cpu, 0); 430 if (!limits->turbo_disabled)
448 if (turbo_pss_ctl > cpu->pstate.max_pstate)
449 cpu->acpi_perf_data.states[0].core_frequency = 431 cpu->acpi_perf_data.states[0].core_frequency =
450 policy->cpuinfo.max_freq / 1000; 432 policy->cpuinfo.max_freq / 1000;
451 cpu->valid_pss_table = true; 433 cpu->valid_pss_table = true;