Skip to content

Commit b34ef93

Browse files
Dasaratharaman Chandramoulirafaeljw
authored andcommitted
intel_pstate: Knights Landing support
1. Add Knights Landing (KNL) CPUID to the list of CPUIDs supported by the intel_pstate driver. 2. Add a new cpu_default structure for KNL since KNL has a slightly different mechanism to get turbo pstates from MSRs. Signed-off-by: Dasaratharaman Chandramouli <[email protected]> Signed-off-by: Kristen Carlson Accardi <[email protected]> [ rjw: Subject and changelog ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5f97899 commit b34ef93

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,19 @@ static void core_set_pstate(struct cpudata *cpudata, int pstate)
614614
wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val);
615615
}
616616

617+
static int knl_get_turbo_pstate(void)
618+
{
619+
u64 value;
620+
int nont, ret;
621+
622+
rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value);
623+
nont = core_get_max_pstate();
624+
ret = (((value) >> 8) & 0xFF);
625+
if (ret <= nont)
626+
ret = nont;
627+
return ret;
628+
}
629+
617630
static struct cpu_defaults core_params = {
618631
.pid_policy = {
619632
.sample_rate_ms = 10,
@@ -651,6 +664,23 @@ static struct cpu_defaults byt_params = {
651664
},
652665
};
653666

667+
static struct cpu_defaults knl_params = {
668+
.pid_policy = {
669+
.sample_rate_ms = 10,
670+
.deadband = 0,
671+
.setpoint = 97,
672+
.p_gain_pct = 20,
673+
.d_gain_pct = 0,
674+
.i_gain_pct = 0,
675+
},
676+
.funcs = {
677+
.get_max = core_get_max_pstate,
678+
.get_min = core_get_min_pstate,
679+
.get_turbo = knl_get_turbo_pstate,
680+
.set = core_set_pstate,
681+
},
682+
};
683+
654684
static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max)
655685
{
656686
int max_perf = cpu->pstate.turbo_pstate;
@@ -865,6 +895,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
865895
ICPU(0x4e, core_params),
866896
ICPU(0x4f, core_params),
867897
ICPU(0x56, core_params),
898+
ICPU(0x57, knl_params),
868899
{}
869900
};
870901
MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);

0 commit comments

Comments
 (0)