public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Huang Rui <ray.huang@amd.com>, Perry Yuan <Perry.Yuan@amd.com>,
	Meng Li <li.meng@amd.com>,
	"Gautham R. Shenoy" <gautham.shenoy@amd.com>
Subject: Re: [PATCH 2/2] cpufreq/amd-pstate: Fix the scaling_min/max_freq setting on shared memory CPPC systems
Date: Wed, 26 Jun 2024 13:40:37 +0530	[thread overview]
Message-ID: <c13b1b65-dd04-468b-a5b8-71d3ed4ff2bb@amd.com> (raw)
In-Reply-To: <be834b5a-508e-49d1-b608-62192cd7bdda@amd.com>

Hello Mario,

On 6/25/2024 8:39 PM, Mario Limonciello wrote:
> On 6/25/2024 08:41, Dhananjay Ugwekar wrote:
>> On shared memory CPPC systems, with amd_pstate=active mode, the change
>> in scaling_min/max_freq doesn't get written to the shared memory
>> region. Due to this, the writes to the scaling_min/max_freq sysfs file
>> don't take effect. Fix this by propagating the scaling_min/max_freq
>> changes to the shared memory region.
>>
>> Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors")
>> Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
>> ---
>>   drivers/cpufreq/amd-pstate.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
>> index 9ad62dbe8bfb..7c1c96abe5bd 100644
>> --- a/drivers/cpufreq/amd-pstate.c
>> +++ b/drivers/cpufreq/amd-pstate.c
>> @@ -264,6 +264,15 @@ static int amd_pstate_set_epp(struct amd_cpudata *cpudata, u32 epp)
>>               cpudata->epp_cached = epp;
>>       } else {
>>           perf_ctrls.energy_perf = epp;
>> +        perf_ctrls.max_perf = cpudata->max_limit_perf;
>> +        perf_ctrls.min_perf = cpudata->min_limit_perf;
>> +        perf_ctrls.desired_perf = 0U;
>> +
>> +        ret = cppc_set_perf(cpudata->cpu, &perf_ctrls);
>> +        if (ret) {
>> +            pr_debug("failed to set min max limits (%d)\n", ret);
>> +            return ret;
>> +        }
> 
> This feels like a handgrown implementation of amd_pstate_update_perf() (IE static call updated to cppc_update_perf).

Yes, I didn't notice it, better to call the existing function.

> 
> Can you just call that instead?
> 
>>           ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1);
>>           if (ret) {
>>               pr_debug("failed to set energy perf value (%d)\n", ret);
>> @@ -1547,6 +1556,7 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
>>       }
>>         WRITE_ONCE(cpudata->cppc_req_cached, value);
>> +
> 
> Spurious newline added here not relevant to this patch.

Yes, will remove it

Regards,
Dhananjay

>>       amd_pstate_set_epp(cpudata, epp);
>>   }
>>   
> 

  reply	other threads:[~2024-06-26  8:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 13:41 [PATCH 0/2] AMD Pstate driver fixes Dhananjay Ugwekar
2024-06-25 13:41 ` [PATCH 1/2] cpufreq/amd-pstate-ut: Handle the inconsistency Dhananjay Ugwekar
2024-06-25 13:51   ` Dhananjay Ugwekar
2024-06-25 15:11     ` Mario Limonciello
2024-06-26  7:56       ` Dhananjay Ugwekar
2024-06-26  1:49     ` Meng, Li (Jassmine)
2024-06-26  5:22       ` Gautham R.Shenoy
2024-06-26  6:45         ` Dhananjay Ugwekar
2024-06-25 15:05   ` Mario Limonciello
2024-06-26  8:02     ` Dhananjay Ugwekar
2024-06-25 13:41 ` [PATCH 2/2] cpufreq/amd-pstate: Fix the scaling_min/max_freq setting on shared memory CPPC systems Dhananjay Ugwekar
2024-06-25 15:09   ` Mario Limonciello
2024-06-26  8:10     ` Dhananjay Ugwekar [this message]
2024-06-26  5:24   ` Gautham R.Shenoy
2024-06-26  7:57     ` Dhananjay Ugwekar

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=c13b1b65-dd04-468b-a5b8-71d3ed4ff2bb@amd.com \
    --to=dhananjay.ugwekar@amd.com \
    --cc=Perry.Yuan@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=li.meng@amd.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=skhan@linuxfoundation.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