Skip to content

Commit 56eb0c0

Browse files
Sean V Kelleyrafaeljw
authored andcommitted
ACPI: CPPC: Fix remaining for_each_possible_cpu() to use online CPUs
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, send_pcc_cmd() and acpi_get_psd_map() still iterate over all possible CPUs. In acpi_get_psd_map(), encountering an offline CPU returns -EFAULT, causing cppc_cpufreq initialization to fail. This breaks systems booted with "nosmt" or "nosmt=force". Fix by using for_each_online_cpu() in both functions. Fixes: 80b8286 ("ACPI / CPPC: support for batching CPPC requests") Signed-off-by: Sean V Kelley <skelley@nvidia.com> Link: https://patch.msgid.link/20260211212254.30190-1-skelley@nvidia.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d84e173 commit 56eb0c0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/acpi/cppc_acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd)
362362
end:
363363
if (cmd == CMD_WRITE) {
364364
if (unlikely(ret)) {
365-
for_each_possible_cpu(i) {
365+
for_each_online_cpu(i) {
366366
struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i);
367367

368368
if (!desc)
@@ -524,7 +524,7 @@ int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data)
524524
else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
525525
cpu_data->shared_type = CPUFREQ_SHARED_TYPE_ANY;
526526

527-
for_each_possible_cpu(i) {
527+
for_each_online_cpu(i) {
528528
if (i == cpu)
529529
continue;
530530

0 commit comments

Comments
 (0)