mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean V Kelley <skelley@nvidia.com>
To: rafael@kernel.org
Cc: lenb@kernel.org, pprakash@codeaurora.org, gautham.shenoy@amd.com,
	jamien@nvidia.com, mochs@nvidia.com, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Sean V Kelley <skelley@nvidia.com>
Subject: [PATCH] ACPI: CPPC: Fix acpi_get_psd_map() to iterate only online CPUs
Date: Wed, 11 Feb 2026 20:48:38 +0000	[thread overview]
Message-ID: <20260211204838.21269-1-skelley@nvidia.com> (raw)

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_get_psd_map() iterates over all possible CPUs
when building the P-state domain map. When it encounters an offline CPU,
it returns -EFAULT, causing cppc_cpufreq initialization to fail.

This breaks systems booted with "nosmt" or "nosmt=force".

Fix by using for_each_online_cpu() so that only CPUs with valid CPC
descriptors are considered.

Fixes: 80b8286aeec0 ("ACPI / CPPC: support for batching CPPC requests")
Signed-off-by: Sean V Kelley <skelley@nvidia.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 a09bdabaa804..e7cfd4cf029a 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -524,7 +524,7 @@ int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data)
 	else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
 		cpu_data->shared_type = CPUFREQ_SHARED_TYPE_ANY;
 
-	for_each_possible_cpu(i) {
+	for_each_online_cpu(i) {
 		if (i == cpu)
 			continue;
 
-- 
2.43.0


             reply	other threads:[~2026-02-11 20:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 20:48 Sean V Kelley [this message]
2026-02-11 21:06 ` Rafael J. Wysocki
2026-02-11 21:14   ` Sean Kelley

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=20260211204838.21269-1-skelley@nvidia.com \
    --to=skelley@nvidia.com \
    --cc=gautham.shenoy@amd.com \
    --cc=jamien@nvidia.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochs@nvidia.com \
    --cc=pprakash@codeaurora.org \
    --cc=rafael@kernel.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

all inboxes | Powered by JetHome®