public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree
       [not found] <20240727143801.959573-1-sashal@kernel.org>
@ 2024-07-27 14:55 ` Dhananjay Ugwekar
  2024-07-30 13:58   ` Sasha Levin
  0 siblings, 1 reply; 5+ messages in thread
From: Dhananjay Ugwekar @ 2024-07-27 14:55 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Huang Rui, Gautham R. Shenoy, Mario Limonciello, Perry Yuan,
	Rafael J. Wysocki, Viresh Kumar

Hello,

Please note that, this specific commit causes a regression in kernels older than 6.9.y, 
it is only needed after "cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq" 
got merged, so please do not port it back to kernels older than that.

Thanks,
Dhananjay


On 7/27/2024 8:08 PM, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
> 
>     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
> 
> to the 6.6-stable tree which can be found at:
>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> The filename of the patch is:
>      cpufreq-amd-pstate-ut-convert-nominal_freq-to-khz-du.patch
> and it can be found in the queue-6.6 subdirectory.
> 
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
> 
> 
> 
> commit ac333983a0338e3009be4d5a59af25fb2da7130c
> Author: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
> Date:   Tue Jul 2 08:14:13 2024 +0000
> 
>     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
>     
>     [ Upstream commit f21ab5ed4e8758b06230900f44b9dcbcfdc0c3ae ]
>     
>     cpudata->nominal_freq being in MHz whereas other frequencies being in
>     KHz breaks the amd-pstate-ut frequency sanity check. This fixes it.
>     
>     Fixes: e4731baaf294 ("cpufreq: amd-pstate: Fix the inconsistency in max frequency units")
>     Reported-by: David Arcari <darcari@redhat.com>
>     Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
>     Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
>     Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
>     Link: https://lore.kernel.org/r/20240702081413.5688-2-Dhananjay.Ugwekar@amd.com
>     Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>     Signed-off-by: Sasha Levin <sashal@kernel.org>
> 
> diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
> index f04ae67dda372..f5e0151f50083 100644
> --- a/drivers/cpufreq/amd-pstate-ut.c
> +++ b/drivers/cpufreq/amd-pstate-ut.c
> @@ -201,6 +201,7 @@ static void amd_pstate_ut_check_freq(u32 index)
>  	int cpu = 0;
>  	struct cpufreq_policy *policy = NULL;
>  	struct amd_cpudata *cpudata = NULL;
> +	u32 nominal_freq_khz;
>  
>  	for_each_possible_cpu(cpu) {
>  		policy = cpufreq_cpu_get(cpu);
> @@ -208,13 +209,14 @@ static void amd_pstate_ut_check_freq(u32 index)
>  			break;
>  		cpudata = policy->driver_data;
>  
> -		if (!((cpudata->max_freq >= cpudata->nominal_freq) &&
> -			(cpudata->nominal_freq > cpudata->lowest_nonlinear_freq) &&
> +		nominal_freq_khz = cpudata->nominal_freq*1000;
> +		if (!((cpudata->max_freq >= nominal_freq_khz) &&
> +			(nominal_freq_khz > cpudata->lowest_nonlinear_freq) &&
>  			(cpudata->lowest_nonlinear_freq > cpudata->min_freq) &&
>  			(cpudata->min_freq > 0))) {
>  			amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
>  			pr_err("%s cpu%d max=%d >= nominal=%d > lowest_nonlinear=%d > min=%d > 0, the formula is incorrect!\n",
> -				__func__, cpu, cpudata->max_freq, cpudata->nominal_freq,
> +				__func__, cpu, cpudata->max_freq, nominal_freq_khz,
>  				cpudata->lowest_nonlinear_freq, cpudata->min_freq);
>  			goto skip_test;
>  		}
> @@ -228,13 +230,13 @@ static void amd_pstate_ut_check_freq(u32 index)
>  
>  		if (cpudata->boost_supported) {
>  			if ((policy->max == cpudata->max_freq) ||
> -					(policy->max == cpudata->nominal_freq))
> +					(policy->max == nominal_freq_khz))
>  				amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS;
>  			else {
>  				amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
>  				pr_err("%s cpu%d policy_max=%d should be equal cpu_max=%d or cpu_nominal=%d !\n",
>  					__func__, cpu, policy->max, cpudata->max_freq,
> -					cpudata->nominal_freq);
> +					nominal_freq_khz);
>  				goto skip_test;
>  			}
>  		} else {

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

* Re: Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree
  2024-07-27 14:55 ` Dhananjay Ugwekar
@ 2024-07-30 13:58   ` Sasha Levin
  0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-07-30 13:58 UTC (permalink / raw)
  To: Dhananjay Ugwekar
  Cc: stable, stable-commits, Huang Rui, Gautham R. Shenoy,
	Mario Limonciello, Perry Yuan, Rafael J. Wysocki, Viresh Kumar

On Sat, Jul 27, 2024 at 08:25:53PM +0530, Dhananjay Ugwekar wrote:
>Hello,
>
>Please note that, this specific commit causes a regression in kernels older than 6.9.y,
>it is only needed after "cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq"
>got merged, so please do not port it back to kernels older than that.

I'll drop it from <6.10. Thanks!

-- 
Thanks,
Sasha

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

* Re: Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree
       [not found] <20241011001826.1646318-1-sashal@kernel.org>
@ 2024-10-14  5:20 ` Dhananjay Ugwekar
  2024-10-14  9:31   ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Dhananjay Ugwekar @ 2024-10-14  5:20 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Huang Rui, Gautham R. Shenoy, Mario Limonciello, Perry Yuan,
	Rafael J. Wysocki, Viresh Kumar

Hello,
 
This patch is only needed post the commit cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq. Hence, please do not add it to the 6.6 stable tree.

Thanks,
Dhananjay


On 10/11/2024 5:48 AM, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
> 
>     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
> 
> to the 6.6-stable tree which can be found at:
>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> The filename of the patch is:
>      cpufreq-amd-pstate-ut-convert-nominal_freq-to-khz-du.patch
> and it can be found in the queue-6.6 subdirectory.
> 
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
> 
> 
> 
> commit 09778adee7fa70b5efeaefd17a6e0a0b9d7de62e
> Author: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
> Date:   Tue Jul 2 08:14:13 2024 +0000
> 
>     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
>     
>     [ Upstream commit f21ab5ed4e8758b06230900f44b9dcbcfdc0c3ae ]
>     
>     cpudata->nominal_freq being in MHz whereas other frequencies being in
>     KHz breaks the amd-pstate-ut frequency sanity check. This fixes it.
>     
>     Fixes: e4731baaf294 ("cpufreq: amd-pstate: Fix the inconsistency in max frequency units")
>     Reported-by: David Arcari <darcari@redhat.com>
>     Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
>     Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
>     Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
>     Link: https://lore.kernel.org/r/20240702081413.5688-2-Dhananjay.Ugwekar@amd.com
>     Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>     Signed-off-by: Sasha Levin <sashal@kernel.org>
> 
> diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
> index f04ae67dda372..f5e0151f50083 100644
> --- a/drivers/cpufreq/amd-pstate-ut.c
> +++ b/drivers/cpufreq/amd-pstate-ut.c
> @@ -201,6 +201,7 @@ static void amd_pstate_ut_check_freq(u32 index)
>  	int cpu = 0;
>  	struct cpufreq_policy *policy = NULL;
>  	struct amd_cpudata *cpudata = NULL;
> +	u32 nominal_freq_khz;
>  
>  	for_each_possible_cpu(cpu) {
>  		policy = cpufreq_cpu_get(cpu);
> @@ -208,13 +209,14 @@ static void amd_pstate_ut_check_freq(u32 index)
>  			break;
>  		cpudata = policy->driver_data;
>  
> -		if (!((cpudata->max_freq >= cpudata->nominal_freq) &&
> -			(cpudata->nominal_freq > cpudata->lowest_nonlinear_freq) &&
> +		nominal_freq_khz = cpudata->nominal_freq*1000;
> +		if (!((cpudata->max_freq >= nominal_freq_khz) &&
> +			(nominal_freq_khz > cpudata->lowest_nonlinear_freq) &&
>  			(cpudata->lowest_nonlinear_freq > cpudata->min_freq) &&
>  			(cpudata->min_freq > 0))) {
>  			amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
>  			pr_err("%s cpu%d max=%d >= nominal=%d > lowest_nonlinear=%d > min=%d > 0, the formula is incorrect!\n",
> -				__func__, cpu, cpudata->max_freq, cpudata->nominal_freq,
> +				__func__, cpu, cpudata->max_freq, nominal_freq_khz,
>  				cpudata->lowest_nonlinear_freq, cpudata->min_freq);
>  			goto skip_test;
>  		}
> @@ -228,13 +230,13 @@ static void amd_pstate_ut_check_freq(u32 index)
>  
>  		if (cpudata->boost_supported) {
>  			if ((policy->max == cpudata->max_freq) ||
> -					(policy->max == cpudata->nominal_freq))
> +					(policy->max == nominal_freq_khz))
>  				amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS;
>  			else {
>  				amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
>  				pr_err("%s cpu%d policy_max=%d should be equal cpu_max=%d or cpu_nominal=%d !\n",
>  					__func__, cpu, policy->max, cpudata->max_freq,
> -					cpudata->nominal_freq);
> +					nominal_freq_khz);
>  				goto skip_test;
>  			}
>  		} else {

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

* Re: Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree
  2024-10-14  5:20 ` Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree Dhananjay Ugwekar
@ 2024-10-14  9:31   ` Greg KH
  2024-10-14 10:43     ` Dhananjay Ugwekar
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2024-10-14  9:31 UTC (permalink / raw)
  To: Dhananjay Ugwekar
  Cc: stable, stable-commits, Huang Rui, Gautham R. Shenoy,
	Mario Limonciello, Perry Yuan, Rafael J. Wysocki, Viresh Kumar

On Mon, Oct 14, 2024 at 10:50:23AM +0530, Dhananjay Ugwekar wrote:
> Hello,
>  
> This patch is only needed post the commit cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq. Hence, please do not add it to the 6.6 stable tree.

Then the tag:

> 
> Thanks,
> Dhananjay
> 
> 
> On 10/11/2024 5:48 AM, Sasha Levin wrote:
> > This is a note to let you know that I've just added the patch titled
> > 
> >     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
> > 
> > to the 6.6-stable tree which can be found at:
> >     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > 
> > The filename of the patch is:
> >      cpufreq-amd-pstate-ut-convert-nominal_freq-to-khz-du.patch
> > and it can be found in the queue-6.6 subdirectory.
> > 
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> > 
> > 
> > 
> > commit 09778adee7fa70b5efeaefd17a6e0a0b9d7de62e
> > Author: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
> > Date:   Tue Jul 2 08:14:13 2024 +0000
> > 
> >     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
> >     
> >     [ Upstream commit f21ab5ed4e8758b06230900f44b9dcbcfdc0c3ae ]
> >     
> >     cpudata->nominal_freq being in MHz whereas other frequencies being in
> >     KHz breaks the amd-pstate-ut frequency sanity check. This fixes it.
> >     
> >     Fixes: e4731baaf294 ("cpufreq: amd-pstate: Fix the inconsistency in max frequency units")

Is wrong?

If so, that's fine, but note that this is why this was added to the
tree.

I'll go drop these from the queue now.

thanks,

greg k-h

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

* Re: Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree
  2024-10-14  9:31   ` Greg KH
@ 2024-10-14 10:43     ` Dhananjay Ugwekar
  0 siblings, 0 replies; 5+ messages in thread
From: Dhananjay Ugwekar @ 2024-10-14 10:43 UTC (permalink / raw)
  To: Greg KH
  Cc: stable, stable-commits, Huang Rui, Gautham R. Shenoy,
	Mario Limonciello, Perry Yuan, Rafael J. Wysocki, Viresh Kumar

Hello,

On 10/14/2024 3:01 PM, Greg KH wrote:
> On Mon, Oct 14, 2024 at 10:50:23AM +0530, Dhananjay Ugwekar wrote:
>> Hello,
>>  
>> This patch is only needed post the commit cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq. Hence, please do not add it to the 6.6 stable tree.
> 
> Then the tag:
> 
>>
>> Thanks,
>> Dhananjay
>>
>>
>> On 10/11/2024 5:48 AM, Sasha Levin wrote:
>>> This is a note to let you know that I've just added the patch titled
>>>
>>>     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
>>>
>>> to the 6.6-stable tree which can be found at:
>>>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>>>
>>> The filename of the patch is:
>>>      cpufreq-amd-pstate-ut-convert-nominal_freq-to-khz-du.patch
>>> and it can be found in the queue-6.6 subdirectory.
>>>
>>> If you, or anyone else, feels it should not be added to the stable tree,
>>> please let <stable@vger.kernel.org> know about it.
>>>
>>>
>>>
>>> commit 09778adee7fa70b5efeaefd17a6e0a0b9d7de62e
>>> Author: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
>>> Date:   Tue Jul 2 08:14:13 2024 +0000
>>>
>>>     cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
>>>     
>>>     [ Upstream commit f21ab5ed4e8758b06230900f44b9dcbcfdc0c3ae ]
>>>     
>>>     cpudata->nominal_freq being in MHz whereas other frequencies being in
>>>     KHz breaks the amd-pstate-ut frequency sanity check. This fixes it.
>>>     
>>>     Fixes: e4731baaf294 ("cpufreq: amd-pstate: Fix the inconsistency in max frequency units")
> 
> Is wrong?

Actually this tag is correct, but the tag for commit "e4731baaf294 ("cpufreq: amd-pstate: Fix the inconsistency in max frequency units")"
was incorrect(i.e. Fixes: ec437d7 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors")), it should've 
been "Fixes: 5547c0ebfc2e ("cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq")" instead.

Sorry about the confusion.

> 
> If so, that's fine, but note that this is why this was added to the
> tree.
> 
> I'll go drop these from the queue now.

Thanks!

Regards,
Dhananjay

> 
> thanks,
> 
> greg k-h

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

end of thread, other threads:[~2024-10-14 10:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241011001826.1646318-1-sashal@kernel.org>
2024-10-14  5:20 ` Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.6-stable tree Dhananjay Ugwekar
2024-10-14  9:31   ` Greg KH
2024-10-14 10:43     ` Dhananjay Ugwekar
     [not found] <20240727143801.959573-1-sashal@kernel.org>
2024-07-27 14:55 ` Dhananjay Ugwekar
2024-07-30 13:58   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox