Skip to content

Commit

Permalink
ACPI: CPPC: Check present CPUs for determining _CPC is valid
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1962230

[ Upstream commit 2aeca6b ]

As this is a static check, it should be based upon what is currently
present on the system. This makes probeing more deterministic.

While local APIC flags field (lapic_flags) of cpu core in MADT table is
0, then the cpu core won't be enabled. In this case, _CPC won't be found
in this core, and return back to _CPC invalid with walking through
possible cpus (include disable cpus). This is not expected, so switch to
check present CPUs instead.

Reported-by: Jinzhou Su <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Huang Rui <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Kamal Mostafa <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
  • Loading branch information
superm1 authored and smb49 committed Mar 24, 2022
1 parent fdeb8fd commit c7f5226
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/cppc_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ bool acpi_cpc_valid(void)
struct cpc_desc *cpc_ptr;
int cpu;

for_each_possible_cpu(cpu) {
for_each_present_cpu(cpu) {
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
if (!cpc_ptr)
return false;
Expand Down

0 comments on commit c7f5226

Please sign in to comment.