From: Christian Loehle <christian.loehle@arm.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>,
Jie Zhan <zhanjie9@hisilicon.com>,
Lifeng Zheng <zhenglifeng1@huawei.com>,
Pierre Gondois <pierre.gondois@arm.com>,
Sumit Gupta <sumitg@nvidia.com>,
Ionela Voinescu <ionela.voinescu@arm.com>
Subject: Re: [PATCH] ACPI: CPPC: Skip writes to unsupported performance controls
Date: Fri, 24 Jul 2026 13:01:53 +0100 [thread overview]
Message-ID: <e4b5b99c-bf38-49f5-89bc-e2ee0b58172f@arm.com> (raw)
In-Reply-To: <20260724-astonishing-hysterical-goldfish-87f8df@sudeepholla>
On 7/24/26 11:57, Sudeep Holla wrote:
> On Fri, Jul 24, 2026 at 11:40:42AM +0100, Christian Loehle wrote:
>> MIN_PERF and MAX_PERF are optional CPPC controls. DESIRED_PERF is also
>> optional with CPPC2 when autonomous selection is supported.
>>
>> The cppc-cpufreq target callbacks populate both limits for every request
>> without checking whether the controls are implemented. cppc_set_perf()
>> consequently passes NULL register descriptors to cpc_write(). The writes
>> fail width validation and their return values are ignored, so the failed
>> access paths are repeated on every target request. An autonomous-only
>> platform can take the same path for DESIRED_PERF.
>>
>> Check that each performance control is supported before calling
>> cpc_write().
>>
>> Fixes: ea3db45ae476 ("cpufreq: cppc: Update MIN_PERF/MAX_PERF in target callbacks")
>> Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
>> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
>> ---
>> v2: Also added desired_perf check (Sumit)
>>
>> drivers/acpi/cppc_acpi.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
>> index 1d3a94100491..53d09ca98f06 100644
>> --- a/drivers/acpi/cppc_acpi.c
>> +++ b/drivers/acpi/cppc_acpi.c
>> @@ -1963,16 +1963,17 @@ int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
>> cpc_desc->write_cmd_status = 0;
>> }
>>
>> - cpc_write(cpu, desired_reg, perf_ctrls->desired_perf);
>> + if (CPC_SUPPORTED(desired_reg))
>> + cpc_write(cpu, desired_reg, perf_ctrls->desired_perf);
>>
>
> In general, can't be set perf_ctrls->desired_perf if and only if
> CPC_SUPPORTED(desired_reg) ?
>
> I see cppc_get_perf() does that but I assume you are catering for some
> other access that may happen before ?
>
cppc-cpufreq sets desired_perf regardless, I guess the check could also move up
there, but down here is fine as well IMO.
next prev parent reply other threads:[~2026-07-24 12:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 10:40 Christian Loehle
2026-07-24 10:57 ` Sudeep Holla
2026-07-24 12:01 ` Christian Loehle [this message]
2026-07-27 11:14 ` zhenglifeng (A)
2026-07-27 12:27 ` Christian Loehle
2026-07-27 13:21 ` Rafael J. Wysocki (Intel)
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=e4b5b99c-bf38-49f5-89bc-e2ee0b58172f@arm.com \
--to=christian.loehle@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--cc=sudeep.holla@kernel.org \
--cc=sumitg@nvidia.com \
--cc=viresh.kumar@linaro.org \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.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
all inboxes | Powered by JetHome®