[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251105143851.4251-4-gautham.shenoy@amd.com>
Date: Wed, 5 Nov 2025 20:08:50 +0530
From: "Gautham R. Shenoy" <gautham.shenoy@....com>
To: "Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
Mario Limonciello <mario.limonciello@....com>, Yunhui Cui
<cuiyunhui@...edance.com>, Jeremy Linton <jeremy.linton@....com>, "Viresh
Kumar" <viresh.kumar@...aro.org>, Ionela Voinescu <ionela.voinescu@....com>
CC: <linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Christopher
Harris" <chris.harris79@...il.com>, <linux-pm@...r.kernel.org>, "Gautham R.
Shenoy" <gautham.shenoy@....com>
Subject: [PATCH 3/4] ACPI: CPPC: Perform fast check switch only for 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 the function cppc_allow_fast_switch() checks for the validity
of the _CPC object for all the present CPUs. This breaks when the
kernel is booted with "nosmt=force".
Check fast_switch capability only on online CPUs
Fixes: 15eece6c5b05 ("ACPI: CPPC: Fix NULL pointer dereference when nosmp is used")
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@....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 50e6348b511f..fb7696b27d82 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -476,7 +476,7 @@ bool cppc_allow_fast_switch(void)
struct cpc_desc *cpc_ptr;
int cpu;
- for_each_present_cpu(cpu) {
+ for_each_online_cpu(cpu) {
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
desired_reg = &cpc_ptr->cpc_regs[DESIRED_PERF];
if (!CPC_IN_SYSTEM_MEMORY(desired_reg) &&
--
2.34.1
Powered by blists - more mailing lists