From: "zhenglifeng (A)" <zhenglifeng1@huawei.com>
To: Christian Loehle <christian.loehle@arm.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Cc: <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>,
Pierre Gondois <pierre.gondois@arm.com>,
Sumit Gupta <sumitg@nvidia.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Ionela Voinescu <ionela.voinescu@arm.com>
Subject: Re: [PATCH] ACPI: CPPC: Skip writes to unsupported performance limits
Date: Mon, 27 Jul 2026 19:10:23 +0800 [thread overview]
Message-ID: <65e5d124-0fb3-4948-9b06-fd42cb5643cd@huawei.com> (raw)
In-Reply-To: <20260723215634.1062264-1-christian.loehle@arm.com>
On 7/24/2026 5:56 AM, Christian Loehle wrote:
> MIN_PERF and MAX_PERF are optional CPPC controls. The cppc-cpufreq
> target callbacks nevertheless populate both values for every request
> without checking whether the controls are implemented.
>
> cppc_set_perf() consequently passes a NULL register descriptor to
> cpc_write(). The write fails width validation and its return value is
> ignored, so the failed access path is repeated on every target request.
>
> Check that each optional limit control is supported before calling
> cpc_write().
>
> Fixes: ea3db45ae476 ("cpufreq: cppc: Update MIN_PERF/MAX_PERF in target callbacks")
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
> ---
> drivers/acpi/cppc_acpi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 1d3a94100491..7bac6d5da24b 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -1970,9 +1970,9 @@ int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
> * value to min and max perf, but they don't mean to set the zero value,
> * they just don't want to write to those registers.
> */
> - if (perf_ctrls->min_perf)
> + if (perf_ctrls->min_perf && CPC_SUPPORTED(min_perf_reg))
> cpc_write(cpu, min_perf_reg, perf_ctrls->min_perf);
> - if (perf_ctrls->max_perf)
> + if (perf_ctrls->max_perf && CPC_SUPPORTED(max_perf_reg))
> cpc_write(cpu, max_perf_reg, perf_ctrls->max_perf);
>
> if (CPC_IN_PCC(desired_reg) || CPC_IN_PCC(min_perf_reg) || CPC_IN_PCC(max_perf_reg))
LGTM.
Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
prev parent reply other threads:[~2026-07-27 11:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 21:56 [PATCH] ACPI: CPPC: Skip writes to unsupported performance limits Christian Loehle
2026-07-24 9:43 ` Sumit Gupta
2026-07-27 11:10 ` zhenglifeng (A) [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=65e5d124-0fb3-4948-9b06-fd42cb5643cd@huawei.com \
--to=zhenglifeng1@huawei.com \
--cc=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@arm.com \
--cc=sumitg@nvidia.com \
--cc=viresh.kumar@linaro.org \
--cc=zhanjie9@hisilicon.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