public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Martins <dan.martins@zoho.com>
To: ray.huang@amd.com, rafael@kernel.org,
	Mario Limonciello <mario.limonciello@amd.com>
Cc: viresh.kumar@linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Mario Limonciello <mario.limonciello@amd.com>,
	stable@vger.kernel.org, wkarny@gmail.com
Subject: Re: [PATCH] cpufreq/amd-pstate: Fix setting scaling max/min freq values
Date: Mon, 22 Jan 2024 18:52:50 -0500	[thread overview]
Message-ID: <2263414.iZASKD2KPV@draconyx> (raw)
In-Reply-To: <20240119113319.54158-1-mario.limonciello@amd.com>

On Friday, January 19, 2024 6:33:19 A.M. EST Mario Limonciello wrote:
> Scaling min/max freq values were being cached and lagging a setting
> each time.  Fix the ordering of the clamp call to ensure they work.
> 
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217931
> Cc: stable@vger.kernel.org
> Cc: wkarny@gmail.com
> Fixes: febab20caeba ("cpufreq/amd-pstate: Fix scaling_min_freq and
> scaling_max_freq update") Signed-off-by: Mario Limonciello
> <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 1f6186475715..1791d37fbc53 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1232,14 +1232,13 @@ static void amd_pstate_epp_update_limit(struct
> cpufreq_policy *policy) max_limit_perf = div_u64(policy->max *
> cpudata->highest_perf, cpudata->max_freq); min_limit_perf =
> div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
> 
> +	WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf);
> +	WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf);
> +
>  	max_perf = clamp_t(unsigned long, max_perf, cpudata-
>min_limit_perf,
>  			cpudata->max_limit_perf);
>  	min_perf = clamp_t(unsigned long, min_perf, cpudata-
>min_limit_perf,
>  			cpudata->max_limit_perf);
> -
> -	WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf);
> -	WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf);
> -
>  	value = READ_ONCE(cpudata->cppc_req_cached);
> 
>  	if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)

Tested-by: Dan Martins <dan.martins@zoho.com>




      parent reply	other threads:[~2024-01-22 23:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 11:33 [PATCH] cpufreq/amd-pstate: Fix setting scaling max/min freq values Mario Limonciello
2024-01-22 14:57 ` Wyes Karny
2024-01-22 19:37   ` Rafael J. Wysocki
2024-01-22 23:52 ` Dan Martins [this message]

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=2263414.iZASKD2KPV@draconyx \
    --to=dan.martins@zoho.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=wkarny@gmail.com \
    /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