public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>,
	rafael@kernel.org, ray.huang@amd.com, viresh.kumar@linaro.org,
	gautham.shenoy@amd.com
Cc: ananth.narayan@amd.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Perry.Yuan@amd.com
Subject: Re: [PATCH] cpufreq: amd-pstate: Fix the inconsistency in max frequency units
Date: Mon, 27 May 2024 09:40:21 -0500	[thread overview]
Message-ID: <929aec0d-690b-4277-90b0-d0b4adb437d3@amd.com> (raw)
In-Reply-To: <20240527051128.110091-1-Dhananjay.Ugwekar@amd.com>

On 5/27/2024 00:11, Dhananjay Ugwekar wrote:
> The nominal frequency in cpudata is maintained in MHz whereas all other
> frequencies are in KHz. This means we have to convert nominal frequency
> value to KHz before we do any interaction with other frequency values.
> 
> In amd_pstate_set_boost(), this conversion from MHz to KHz is missed,
> fix that.
> 
> Tested on a AMD Zen4 EPYC server
> 
> Before:
> $ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq | uniq
> 2151
> $ cat /sys/devices/system/cpu/cpufreq/policy*/cpuinfo_min_freq | uniq
> 400000
> $ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq | uniq
> 2151
> 409422
> 
> After:
> $ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq | uniq
> 2151000
> $ cat /sys/devices/system/cpu/cpufreq/policy*/cpuinfo_min_freq | uniq
> 400000
> $ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq | uniq
> 2151000
> 1799527
> 

Cc: stable@vger.kernel.org

> Fixes: ec437d71db77 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors")
> Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>

Acked-by: Mario Limonciello <mario.limonciello@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 1b7e82a0ad2e..cde3b91b4422 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -669,7 +669,7 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
>   	if (state)
>   		policy->cpuinfo.max_freq = cpudata->max_freq;
>   	else
> -		policy->cpuinfo.max_freq = cpudata->nominal_freq;
> +		policy->cpuinfo.max_freq = cpudata->nominal_freq * 1000;
>   
>   	policy->max = policy->cpuinfo.max_freq;
>   


  reply	other threads:[~2024-05-27 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27  5:11 [PATCH] cpufreq: amd-pstate: Fix the inconsistency in max frequency units Dhananjay Ugwekar
2024-05-27 14:40 ` Mario Limonciello [this message]
2024-05-27 15:45   ` Gautham R. Shenoy
2024-05-28 17:25     ` Peter Jung
2024-05-28 20:05   ` Rafael J. Wysocki

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=929aec0d-690b-4277-90b0-d0b4adb437d3@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Dhananjay.Ugwekar@amd.com \
    --cc=Perry.Yuan@amd.com \
    --cc=ananth.narayan@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --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