From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
Yunhui Cui <cuiyunhui@bytedance.com>,
Jeremy Linton <jeremy.linton@arm.com>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
Ionela Voinescu <ionela.voinescu@arm.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"Christopher Harris" <chris.harris79@gmail.com>,
<linux-pm@vger.kernel.org>,
"Gautham R. Shenoy" <gautham.shenoy@amd.com>,
"Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
Subject: [PATCH v2 2/5] ACPI: CPPC: Check _CPC validity for only the online CPUs
Date: Fri, 7 Nov 2025 13:11:42 +0530 [thread overview]
Message-ID: <20251107074145.2340-3-gautham.shenoy@amd.com> (raw)
In-Reply-To: <20251107074145.2340-1-gautham.shenoy@amd.com>
per_cpu(cpc_desc_ptr, cpu) object is initialized for only the online
CPUs via acpi_soft_cpu_online() --> __acpi_processor_start() -->
acpi_cppc_processor_probe().
However the function acpi_cpc_valid() checks for the validity of the
_CPC object for all the present CPUs. This breaks when the kernel is
booted with "nosmt=force".
Hence check the validity of the _CPC objects of only the online CPUs.
Fixes: 2aeca6bd0277 ("ACPI: CPPC: Check present CPUs for determining _CPC is valid")
Reported-by: Christopher Harris <chris.harris79@gmail.com>
Closes: https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.com/
Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
Tested-by: Chrisopher Harris <chris.harris79@gmail.com>
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
drivers/acpi/cppc_acpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index ab4651205e8a..50e6348b511f 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -460,7 +460,7 @@ bool acpi_cpc_valid(void)
if (acpi_disabled)
return false;
- for_each_present_cpu(cpu) {
+ for_each_online_cpu(cpu) {
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
if (!cpc_ptr)
return false;
--
2.34.1
next prev parent reply other threads:[~2025-11-07 7:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 7:41 [PATCH v2 0/5] CPPC/amd-pstate: Fixes to limit actions to online CPUs Gautham R. Shenoy
2025-11-07 7:41 ` [PATCH v2 1/5] ACPI: CPPC: Detect preferred core availability on " Gautham R. Shenoy
2025-11-07 7:41 ` Gautham R. Shenoy [this message]
2025-11-07 7:41 ` [PATCH v2 3/5] ACPI: CPPC: Perform fast check switch only for " Gautham R. Shenoy
2025-11-07 7:41 ` [PATCH v2 4/5] ACPI: CPPC: Limit perf ctrs in PCC check only to " Gautham R. Shenoy
2025-11-07 7:41 ` [PATCH v2 5/5] cpufreq/amd-pstate: Call cppc_set_auto_sel() only for " Gautham R. Shenoy
2025-11-07 17:41 ` [PATCH v2 0/5] CPPC/amd-pstate: Fixes to limit actions to " Rafael J. Wysocki
2025-11-09 4:04 ` Chris Harris
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=20251107074145.2340-3-gautham.shenoy@amd.com \
--to=gautham.shenoy@amd.com \
--cc=chris.harris79@gmail.com \
--cc=cuiyunhui@bytedance.com \
--cc=ionela.voinescu@arm.com \
--cc=jeremy.linton@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=mario.limonciello@amd.com \
--cc=rafael@kernel.org \
--cc=superm1@kernel.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;
as well as URLs for NNTP newsgroup(s).