Linux ACPI
 help / color / mirror / Atom feed
From: Zhongqiu Han <zhongqiu.han@oss.qualcomm.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>,
	Lifeng Zheng <zhenglifeng1@huawei.com>,
	Pierre Gondois <pierre.gondois@arm.com>,
	Sumit Gupta <sumitg@nvidia.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Ionela Voinescu <ionela.voinescu@arm.com>,
	stable@vger.kernel.org, zhongqiu.han@oss.qualcomm.com
Subject: Re: [PATCHv2 2/3] ACPI: CPPC: Skip desired_perf read in cppc_get_perf()
Date: Fri, 31 Jul 2026 20:38:51 +0800	[thread overview]
Message-ID: <4a0eaf75-9cf0-4a98-84ee-c10442faa646@oss.qualcomm.com> (raw)
In-Reply-To: <20260729100245.2628302-3-christian.loehle@arm.com>

On 7/29/2026 6:02 PM, Christian Loehle wrote:
> ACPI 6.6 changed the Optional Attribute of Desired Performance from
> Read/Write to Write. cppc_get_perf() nevertheless reads the register when
> initializing performance controls, even though cppc-cpufreq overwrites the
> value before using it.
> 
> Use the readability check from cppc_get_desired_perf() and leave
> desired_perf zero instead of reading it on ACPI 6.6 or later. Also exclude
> the register from PCC read-command detection so it cannot trigger an
> otherwise unnecessary read command.
> 
> Fixes: 658fa7b1c47a ("ACPI: CPPC: Add cppc_get_perf() API to read performance controls")
> Cc: stable@vger.kernel.org
> Suggested-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>

Looks good to me.

Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>

> ---
>   drivers/acpi/cppc_acpi.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 6e5381f8de38..210988d57b71 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -1843,6 +1843,7 @@ int cppc_get_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
>   	u64 desired_perf = 0, min = 0, max = 0, energy_perf = 0, auto_sel = 0;
>   	int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
>   	struct cppc_pcc_data *pcc_ss_data = NULL;
> +	bool read_desired_perf = cppc_desired_perf_readable();
>   	int ret = 0, regs_in_pcc = 0;
>   
>   	if (!cpc_desc) {
> @@ -1862,7 +1863,8 @@ int cppc_get_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
>   	auto_sel_reg = &cpc_desc->cpc_regs[AUTO_SEL_ENABLE];
>   
>   	/* Are any of the regs PCC ?*/
> -	if (CPC_IN_PCC(desired_perf_reg) || CPC_IN_PCC(min_perf_reg) ||
> +	if ((read_desired_perf && CPC_IN_PCC(desired_perf_reg)) ||
> +	    CPC_IN_PCC(min_perf_reg) ||
>   	    CPC_IN_PCC(max_perf_reg) || CPC_IN_PCC(energy_perf_reg) ||
>   	    CPC_IN_PCC(auto_sel_reg)) {
>   		if (pcc_ss_id < 0) {
> @@ -1894,7 +1896,7 @@ int cppc_get_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
>   	}
>   	perf_ctrls->min_perf = min;
>   
> -	if (CPC_SUPPORTED(desired_perf_reg)) {
> +	if (read_desired_perf && CPC_SUPPORTED(desired_perf_reg)) {
>   		ret = cpc_read(cpu, desired_perf_reg, &desired_perf);
>   		if (ret)
>   			goto out_err;


-- 
Thx and BRs,
Zhongqiu Han

  reply	other threads:[~2026-07-31 12:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 10:02 [PATCHv2 0/3] ACPI: CPPC: Avoid Desired Performance reads on ACPI 6.6+ Christian Loehle
2026-07-29 10:02 ` [PATCHv2 1/3] ACPI: CPPC: Reject desired_perf " Christian Loehle
2026-07-31 10:45   ` Zhongqiu Han
2026-08-03  9:12     ` Christian Loehle
2026-07-31 20:52   ` Sumit Gupta
2026-07-29 10:02 ` [PATCHv2 2/3] ACPI: CPPC: Skip desired_perf read in cppc_get_perf() Christian Loehle
2026-07-31 12:38   ` Zhongqiu Han [this message]
2026-07-29 10:02 ` [PATCHv2 3/3] ACPI: CPPC: Stop reading desired_perf " Christian Loehle
2026-07-31 13:19   ` Zhongqiu Han
2026-08-03 10:02 ` [PATCH v3 0/3] ACPI: CPPC: Avoid Desired Performance reads on ACPI 6.6+ Christian Loehle
2026-08-03 10:02   ` [PATCH v3 1/3] ACPI: CPPC: Reject desired_perf " Christian Loehle
2026-08-03 14:38     ` Rafael J. Wysocki (Intel)
2026-08-03 14:44       ` Christian Loehle
2026-08-03 10:02   ` [PATCH v3 2/3] ACPI: CPPC: Skip desired_perf read in cppc_get_perf() Christian Loehle
2026-08-03 14:43     ` Rafael J. Wysocki (Intel)
2026-08-03 10:02   ` [PATCH v3 3/3] ACPI: CPPC: Stop reading desired_perf " Christian Loehle
2026-08-03 13:07   ` [PATCH v3 0/3] ACPI: CPPC: Avoid Desired Performance reads on ACPI 6.6+ Sumit Gupta

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=4a0eaf75-9cf0-4a98-84ee-c10442faa646@oss.qualcomm.com \
    --to=zhongqiu.han@oss.qualcomm.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=stable@vger.kernel.org \
    --cc=sudeep.holla@arm.com \
    --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