]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI: CPPC: Limit perf ctrs in PCC check only to online CPUs
authorGautham R. Shenoy <gautham.shenoy@amd.com>
Fri, 7 Nov 2025 07:41:44 +0000 (13:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Nov 2025 09:35:53 +0000 (10:35 +0100)
[ Upstream commit 0fce75870666b46b700cfbd3216380b422f975da ]

per_cpu(cpc_desc_ptr, cpu) object is initialized for only the online
CPU via acpi_soft_cpu_online() --> __acpi_processor_start() -->
acpi_cppc_processor_probe().

However the function cppc_perf_ctrs_in_pcc() checks if the CPPC
perf-ctrs are in a PCC region for all the present CPUs, which breaks
when the kernel is booted with "nosmt=force".

Hence, limit the check only to the online CPUs.

Fixes: ae2df912d1a5 ("ACPI: CPPC: Disable FIE if registers in PCC regions")
Reviewed-by: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Link: https://patch.msgid.link/20251107074145.2340-5-gautham.shenoy@amd.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/cppc_acpi.c

index c4a1fee4b487342dca2552c767c0960948313fb0..62b723f6c48df202b0d91fd193d8dbbedf600b27 100644 (file)
@@ -1366,7 +1366,7 @@ bool cppc_perf_ctrs_in_pcc(void)
 {
        int cpu;
 
-       for_each_present_cpu(cpu) {
+       for_each_online_cpu(cpu) {
                struct cpc_register_resource *ref_perf_reg;
                struct cpc_desc *cpc_desc;