Skip to content

Commit bde4f5f

Browse files
spandruvadarafaeljw
authored andcommitted
cpufreq: intel_pstate: Update hybrid scaling factor for Meteor Lake
On some Meteor Lake platforms, maximum one core turbo frequency is not observed. During hybrid performance to frequency conversion, the maximum frequency is 100 MHz less. This results in requesting maximum frequency 100 MHz less. For example when the max one core turbo is 4.9 GHz: MSR HWP_CAPABILITIES shows highest performance ratio for P-core is 0x3E. With the current scaling factor of 78741 (1.27x for converting frequency to performance) results in max frequency of 4.8 GHz. This results in capping the max scaling frequency as 4.8 GHz, which is 100 MHz less than the desired. Add capability to define per CPU model specific scaling factor and define scaling factor of 80000 (1.25x for converting frequency to performance for P-cores) for Meteor Lake. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> [ rjw: Debug message adjustment, subject edit ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent e956c88 commit bde4f5f

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ static bool hwp_forced __read_mostly;
302302

303303
static struct cpufreq_driver *intel_pstate_driver __read_mostly;
304304

305-
#define HYBRID_SCALING_FACTOR 78741
305+
#define HYBRID_SCALING_FACTOR 78741
306+
#define HYBRID_SCALING_FACTOR_MTL 80000
307+
308+
static int hybrid_scaling_factor = HYBRID_SCALING_FACTOR;
306309

307310
static inline int core_get_scaling(void)
308311
{
@@ -422,7 +425,7 @@ static int intel_pstate_cppc_get_scaling(int cpu)
422425
*/
423426
if (!ret && cppc_perf.nominal_perf && cppc_perf.nominal_freq &&
424427
cppc_perf.nominal_perf * 100 != cppc_perf.nominal_freq)
425-
return HYBRID_SCALING_FACTOR;
428+
return hybrid_scaling_factor;
426429

427430
return core_get_scaling();
428431
}
@@ -1968,7 +1971,7 @@ static int hwp_get_cpu_scaling(int cpu)
19681971
smp_call_function_single(cpu, hybrid_get_type, &cpu_type, 1);
19691972
/* P-cores have a smaller perf level-to-freqency scaling factor. */
19701973
if (cpu_type == 0x40)
1971-
return HYBRID_SCALING_FACTOR;
1974+
return hybrid_scaling_factor;
19721975

19731976
/* Use default core scaling for E-cores */
19741977
if (cpu_type == 0x20)
@@ -3399,6 +3402,11 @@ static const struct x86_cpu_id intel_epp_balance_perf[] = {
33993402
{}
34003403
};
34013404

3405+
static const struct x86_cpu_id intel_hybrid_scaling_factor[] = {
3406+
X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, HYBRID_SCALING_FACTOR_MTL),
3407+
{}
3408+
};
3409+
34023410
static int __init intel_pstate_init(void)
34033411
{
34043412
static struct cpudata **_all_cpu_data;
@@ -3489,9 +3497,16 @@ static int __init intel_pstate_init(void)
34893497

34903498
if (hwp_active) {
34913499
const struct x86_cpu_id *id = x86_match_cpu(intel_epp_balance_perf);
3500+
const struct x86_cpu_id *hybrid_id = x86_match_cpu(intel_hybrid_scaling_factor);
34923501

34933502
if (id)
34943503
epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = id->driver_data;
3504+
3505+
if (hybrid_id) {
3506+
hybrid_scaling_factor = hybrid_id->driver_data;
3507+
pr_debug("hybrid scaling factor: %d\n", hybrid_scaling_factor);
3508+
}
3509+
34953510
}
34963511

34973512
mutex_lock(&intel_pstate_driver_lock);

0 commit comments

Comments
 (0)