From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: [PATCH] cpufreq/intel_pstate: Load only on Intel hardware Date: Mon, 1 Apr 2019 17:03:45 +0200 Message-ID: <20190401150345.GJ28264@zn.tnic> References: <20190330100225.14744-1-bp@alien8.de> <20190401083902.GC28264@zn.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <20190401083902.GC28264@zn.tnic> Sender: linux-kernel-owner@vger.kernel.org To: Erwan Velu Cc: LKML , Len Brown , "linux-pm@vger.kernel.org" , "Rafael J . Wysocki" , Srinivas Pandruvada , Viresh Kumar List-Id: linux-pm@vger.kernel.org From: Borislav Petkov 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. Suggested-by: Erwan Velu Signed-off-by: Borislav Petkov Cc: Len Brown Cc: linux-pm@vger.kernel.org Cc: Rafael J. Wysocki CC: Srinivas Pandruvada Cc: Viresh Kumar --- drivers/cpufreq/intel_pstate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index b599c7318aab..2986119dd31f 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -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; @@ -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; } -- 2.21.0 -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.