From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
To: stable@vger.kernel.org, stable-commits@vger.kernel.org
Cc: Huang Rui <ray.huang@amd.com>,
"Gautham R. Shenoy" <gautham.shenoy@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Perry Yuan <perry.yuan@amd.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: Patch "cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons" has been added to the 6.1-stable tree
Date: Mon, 14 Oct 2024 10:52:13 +0530 [thread overview]
Message-ID: <f2c22367-b2d1-4ba7-8d4e-adc881dac96d@amd.com> (raw)
In-Reply-To: <20241011001952.1647600-1-sashal@kernel.org>
Hello,
This patch is only needed post the commit cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq (https://github.com/torvalds/linux/commit/5547c0ebfc2efdab6ee93a7fd4d9c411ad87013e). Hence, please do not add it to the 6.1 stable tree.
Thanks,
Dhananjay
On 10/11/2024 5:49 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.1-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.1 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 f73b7329361c75898fc97abd91c86a12bfe34830
> 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 b448c8d6a16dd..9c1fc386c010f 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 {
parent reply other threads:[~2024-10-14 5:22 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20241011001952.1647600-1-sashal@kernel.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2c22367-b2d1-4ba7-8d4e-adc881dac96d@amd.com \
--to=dhananjay.ugwekar@amd.com \
--cc=gautham.shenoy@amd.com \
--cc=mario.limonciello@amd.com \
--cc=perry.yuan@amd.com \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).