Skip to content

Commit 4fe5934

Browse files
gautshenrafaeljw
authored andcommitted
ACPI: CPPC: Detect preferred core availability on online CPUs
Commit 279f838 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()") introduced the ability to detect the preferred core on AMD platforms by checking if there at least two distinct highest_perf values. However, it uses for_each_present_cpu() to iterate through all the CPUs in the platform, which is problematic when the kernel is booted with "nosmt=force" commandline option. Hence limit the search to only the online CPUs. Fixes: 279f838 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()") Reported-by: Christopher Harris <chris.harris79@gmail.com> Closes: https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.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> Link: https://patch.msgid.link/20251107074145.2340-2-gautham.shenoy@amd.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1642fab commit 4fe5934

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/kernel/acpi/cppc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ int amd_detect_prefcore(bool *detected)
196196
break;
197197
}
198198

199-
for_each_present_cpu(cpu) {
199+
for_each_online_cpu(cpu) {
200200
u32 tmp;
201201
int ret;
202202

0 commit comments

Comments
 (0)