[PATCH 02/12] cpufreq/amd-pstate: Fix max_perf updation with schedutil

Dhananjay Ugwekar posted 12 patches 10 months, 1 week ago
[PATCH 02/12] cpufreq/amd-pstate: Fix max_perf updation with schedutil
Posted by Dhananjay Ugwekar 10 months, 1 week ago
In adjust_perf() callback, we are setting the max_perf to highest_perf,
as opposed to the correct limit value i.e. max_limit_perf. Fix that.

Fixes: 3f7b835fa4d0 ("cpufreq/amd-pstate: Move limit updating code")
Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index b163c1699821..9dc3933bc326 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -699,7 +699,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
 	if (min_perf < lowest_nonlinear_perf)
 		min_perf = lowest_nonlinear_perf;
 
-	max_perf = cap_perf;
+	max_perf = cpudata->max_limit_perf;
 	if (max_perf < min_perf)
 		max_perf = min_perf;
 
-- 
2.34.1
Re: [PATCH 02/12] cpufreq/amd-pstate: Fix max_perf updation with schedutil
Posted by Gautham R. Shenoy 10 months, 1 week ago
On Wed, Feb 05, 2025 at 11:25:13AM +0000, Dhananjay Ugwekar wrote:
> In adjust_perf() callback, we are setting the max_perf to highest_perf,
> as opposed to the correct limit value i.e. max_limit_perf. Fix that.
> 
> Fixes: 3f7b835fa4d0 ("cpufreq/amd-pstate: Move limit updating code")
> Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>

-- 
Thanks and Regards
gautham.
> ---
>  drivers/cpufreq/amd-pstate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index b163c1699821..9dc3933bc326 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -699,7 +699,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
>  	if (min_perf < lowest_nonlinear_perf)
>  		min_perf = lowest_nonlinear_perf;
>  
> -	max_perf = cap_perf;
> +	max_perf = cpudata->max_limit_perf;
>  	if (max_perf < min_perf)
>  		max_perf = min_perf;
>  
> -- 
> 2.34.1
>
Re: [PATCH 02/12] cpufreq/amd-pstate: Fix max_perf updation with schedutil
Posted by Mario Limonciello 10 months, 1 week ago
On 2/5/2025 05:25, Dhananjay Ugwekar wrote:
> In adjust_perf() callback, we are setting the max_perf to highest_perf,
> as opposed to the correct limit value i.e. max_limit_perf. Fix that.
> 
> Fixes: 3f7b835fa4d0 ("cpufreq/amd-pstate: Move limit updating code")
> Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>

Thanks.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

I'll queue this fix for 6.14-rc.
> ---
>   drivers/cpufreq/amd-pstate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index b163c1699821..9dc3933bc326 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -699,7 +699,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
>   	if (min_perf < lowest_nonlinear_perf)
>   		min_perf = lowest_nonlinear_perf;
>   
> -	max_perf = cap_perf;
> +	max_perf = cpudata->max_limit_perf;
>   	if (max_perf < min_perf)
>   		max_perf = min_perf;
>