diff mbox series

cpufreq/intel_pstate: Do not issue the not supported message on !Intel

Message ID 20190330100225.14744-1-bp@alien8.de (mailing list archive)
State Not Applicable, archived
Headers show
Series cpufreq/intel_pstate: Do not issue the not supported message on !Intel | expand

Commit Message

Borislav Petkov March 30, 2019, 10:02 a.m. UTC
From: Borislav Petkov <bp@suse.de>

Issue the CPU-not-supported message only on Intel machines as this
driver is Intel-only. Which means, the print statement can remain
KERN_INFO for ease of debugging (no need to enable it first in dynamic
debug).

While at it, correct it to say CPU "model" which is what that test does.

Fixes: 076b862c7e44 ("cpufreq: intel_pstate: Add reasons for failure and debug messages")
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Erwan Velu <e.velu@criteo.com>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
CC: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/intel_pstate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Erwan Velu April 1, 2019, 8:11 a.m. UTC | #1
> index ea62e3f02d56..19854f01e2fa 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -2608,7 +2608,9 @@ 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");
> +			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
> +				pr_info("CPU model not supported\n");
> +
>   			return -ENODEV;
>   		}

That's a good catch but I was wondering why not putting this vendor 
condition at the initial "if (noload)" statement.

I mean, if we don't run an intel CPU there is no need of making the 
x86_match_cpu().

This commit is also killing the case of reporting an unsupported intel 
processor.


I'd suggest something like this and keep the 'CPUID not supported' part 
untouched.

     if (no_load) || (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)

         return -ENODEV
Borislav Petkov April 1, 2019, 8:39 a.m. UTC | #2
On Mon, Apr 01, 2019 at 08:11:51AM +0000, Erwan Velu wrote:
> I'd suggest something like this and keep the 'CPUID not supported' part 
> untouched.
> 
>      if (no_load) || (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)

Yeah, that's the usual thing we do in such cases and the better idea,
I'll do that in v2.

Thx.
diff mbox series

Patch

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index ea62e3f02d56..19854f01e2fa 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2608,7 +2608,9 @@  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");
+			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
+				pr_info("CPU model not supported\n");
+
 			return -ENODEV;
 		}