linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: powernow-k8: Re-order the init checks
@ 2022-03-16 21:55 Mario Limonciello
  2022-03-17  4:03 ` Viresh Kumar
  2022-03-17  7:17 ` Huang Rui
  0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello @ 2022-03-16 21:55 UTC (permalink / raw)
  To: mario.limonciello, Rafael J. Wysocki, Viresh Kumar,
	open list:CPU FREQUENCY SCALING FRAMEWORK, open list
  Cc: Ray.Huang

The powernow-k8 driver will do checks at startup that the current
active driver is acpi-cpufreq and show a warning when they're not
expected.

Because of this the following warning comes up on systems that
support amd-pstate and compiled in both drivers:
`WTF driver: amd-pstate`

The systems that support powernow-k8 will not support amd-pstate,
so re-order the checks to validate the CPU model number first to
avoid this warning being displayed on modern SOCs.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/cpufreq/powernow-k8.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 12ab4014af71..d289036beff2 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1172,14 +1172,14 @@ static int powernowk8_init(void)
 	unsigned int i, supported_cpus = 0;
 	int ret;
 
+	if (!x86_match_cpu(powernow_k8_ids))
+		return -ENODEV;
+
 	if (boot_cpu_has(X86_FEATURE_HW_PSTATE)) {
 		__request_acpi_cpufreq();
 		return -ENODEV;
 	}
 
-	if (!x86_match_cpu(powernow_k8_ids))
-		return -ENODEV;
-
 	cpus_read_lock();
 	for_each_online_cpu(i) {
 		smp_call_function_single(i, check_supported_cpu, &ret, 1);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: powernow-k8: Re-order the init checks
  2022-03-16 21:55 [PATCH] cpufreq: powernow-k8: Re-order the init checks Mario Limonciello
@ 2022-03-17  4:03 ` Viresh Kumar
  2022-03-17  7:17 ` Huang Rui
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2022-03-17  4:03 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Rafael J. Wysocki, open list:CPU FREQUENCY SCALING FRAMEWORK,
	open list, Ray.Huang

On 16-03-22, 16:55, Mario Limonciello wrote:
> The powernow-k8 driver will do checks at startup that the current
> active driver is acpi-cpufreq and show a warning when they're not
> expected.
> 
> Because of this the following warning comes up on systems that
> support amd-pstate and compiled in both drivers:
> `WTF driver: amd-pstate`
> 
> The systems that support powernow-k8 will not support amd-pstate,
> so re-order the checks to validate the CPU model number first to
> avoid this warning being displayed on modern SOCs.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/powernow-k8.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
> index 12ab4014af71..d289036beff2 100644
> --- a/drivers/cpufreq/powernow-k8.c
> +++ b/drivers/cpufreq/powernow-k8.c
> @@ -1172,14 +1172,14 @@ static int powernowk8_init(void)
>  	unsigned int i, supported_cpus = 0;
>  	int ret;
>  
> +	if (!x86_match_cpu(powernow_k8_ids))
> +		return -ENODEV;
> +
>  	if (boot_cpu_has(X86_FEATURE_HW_PSTATE)) {
>  		__request_acpi_cpufreq();
>  		return -ENODEV;
>  	}
>  
> -	if (!x86_match_cpu(powernow_k8_ids))
> -		return -ENODEV;
> -
>  	cpus_read_lock();
>  	for_each_online_cpu(i) {
>  		smp_call_function_single(i, check_supported_cpu, &ret, 1);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: powernow-k8: Re-order the init checks
  2022-03-16 21:55 [PATCH] cpufreq: powernow-k8: Re-order the init checks Mario Limonciello
  2022-03-17  4:03 ` Viresh Kumar
@ 2022-03-17  7:17 ` Huang Rui
  1 sibling, 0 replies; 3+ messages in thread
From: Huang Rui @ 2022-03-17  7:17 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Rafael J. Wysocki, Viresh Kumar,
	open list:CPU FREQUENCY SCALING FRAMEWORK, open list

On Thu, Mar 17, 2022 at 05:55:48AM +0800, Limonciello, Mario wrote:
> The powernow-k8 driver will do checks at startup that the current
> active driver is acpi-cpufreq and show a warning when they're not
> expected.
> 
> Because of this the following warning comes up on systems that
> support amd-pstate and compiled in both drivers:
> `WTF driver: amd-pstate`
> 
> The systems that support powernow-k8 will not support amd-pstate,
> so re-order the checks to validate the CPU model number first to
> avoid this warning being displayed on modern SOCs.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> ---
>  drivers/cpufreq/powernow-k8.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
> index 12ab4014af71..d289036beff2 100644
> --- a/drivers/cpufreq/powernow-k8.c
> +++ b/drivers/cpufreq/powernow-k8.c
> @@ -1172,14 +1172,14 @@ static int powernowk8_init(void)
>  	unsigned int i, supported_cpus = 0;
>  	int ret;
>  
> +	if (!x86_match_cpu(powernow_k8_ids))
> +		return -ENODEV;
> +
>  	if (boot_cpu_has(X86_FEATURE_HW_PSTATE)) {
>  		__request_acpi_cpufreq();
>  		return -ENODEV;
>  	}
>  
> -	if (!x86_match_cpu(powernow_k8_ids))
> -		return -ENODEV;
> -
>  	cpus_read_lock();
>  	for_each_online_cpu(i) {
>  		smp_call_function_single(i, check_supported_cpu, &ret, 1);
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-17  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 21:55 [PATCH] cpufreq: powernow-k8: Re-order the init checks Mario Limonciello
2022-03-17  4:03 ` Viresh Kumar
2022-03-17  7:17 ` Huang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).