Skip to content

Commit

Permalink
cpufreq/intel_pstate: Load only on Intel hardware
Browse files Browse the repository at this point in the history
This driver is Intel-only so loading on anything which is not Intel is
pointless. Prevent it from doing so.

While at it, correct the "not supported" print statement to say CPU
"model" which is what that test does.

Fixes: 076b862 (cpufreq: intel_pstate: Add reasons for failure and debug messages)
Suggested-by: Erwan Velu <e.velu@criteo.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Borislav Petkov authored and Rafael J. Wysocki committed Apr 1, 2019
1 parent 79a3aaa commit 4ab5264
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2596,6 +2596,9 @@ static int __init intel_pstate_init(void)
const struct x86_cpu_id *id;
int rc;

if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
return -ENODEV;

if (no_load)
return -ENODEV;

Expand All @@ -2611,7 +2614,7 @@ static int __init intel_pstate_init(void)
} else {
id = x86_match_cpu(intel_pstate_cpu_ids);
if (!id) {
pr_info("CPU ID not supported\n");
pr_info("CPU model not supported\n");
return -ENODEV;
}

Expand Down

0 comments on commit 4ab5264

Please sign in to comment.