Skip to content

Commit eb5139d

Browse files
committed
cpufreq: intel_pstate: Support HWP processors in all operation modes
Currently, some processors supporting HWP are only supported by intel_pstate if HWP is actually going to be used and not supported otherwise which is confusing. Specifically, they are not supported if "intel_pstate=no_hwp" is passed to the kernel in the command line or if the driver is started in the passive mode ("intel_pstate=passive"). There is no real reason for that, because everything about those processor is known anyway and the driver can work with them in all modes, so make that happen, but use the load-based P-state selection algorithm for the active mode "powersave" policy with them. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent f1a9164 commit eb5139d

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,28 +2627,33 @@ static const struct x86_cpu_id hwp_support_ids[] __initconst = {
26272627

26282628
static int __init intel_pstate_init(void)
26292629
{
2630-
const struct x86_cpu_id *id;
2631-
struct cpu_defaults *cpu_def;
2632-
int rc = 0;
2630+
int rc;
26332631

26342632
if (no_load)
26352633
return -ENODEV;
26362634

2637-
if (x86_match_cpu(hwp_support_ids) && !no_hwp) {
2635+
if (x86_match_cpu(hwp_support_ids)) {
26382636
copy_cpu_funcs(&core_params.funcs);
2639-
hwp_active++;
2640-
intel_pstate.attr = hwp_cpufreq_attrs;
2641-
goto hwp_cpu_matched;
2642-
}
2637+
if (no_hwp) {
2638+
pstate_funcs.get_target_pstate = get_target_pstate_use_cpu_load;
2639+
} else {
2640+
hwp_active++;
2641+
intel_pstate.attr = hwp_cpufreq_attrs;
2642+
goto hwp_cpu_matched;
2643+
}
2644+
} else {
2645+
const struct x86_cpu_id *id;
2646+
struct cpu_defaults *cpu_def;
26432647

2644-
id = x86_match_cpu(intel_pstate_cpu_ids);
2645-
if (!id)
2646-
return -ENODEV;
2648+
id = x86_match_cpu(intel_pstate_cpu_ids);
2649+
if (!id)
2650+
return -ENODEV;
26472651

2648-
cpu_def = (struct cpu_defaults *)id->driver_data;
2652+
cpu_def = (struct cpu_defaults *)id->driver_data;
26492653

2650-
copy_pid_params(&cpu_def->pid_policy);
2651-
copy_cpu_funcs(&cpu_def->funcs);
2654+
copy_pid_params(&cpu_def->pid_policy);
2655+
copy_cpu_funcs(&cpu_def->funcs);
2656+
}
26522657

26532658
if (intel_pstate_msrs_not_valid())
26542659
return -ENODEV;

0 commit comments

Comments
 (0)