From: Mario Limonciello Date: Fri, 24 Dec 2021 01:04:58 +0000 (+0800) Subject: ACPI: CPPC: Check present CPUs for determining _CPC is valid X-Git-Tag: v5.17-rc1~167^2~2^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2aeca6bd02776d7f56a49a32be0dd184f204d888;p=thirdparty%2Fkernel%2Flinux.git ACPI: CPPC: Check present CPUs for determining _CPC is valid 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 Signed-off-by: Mario Limonciello Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 69e0746470033..cc790037d643a 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -413,7 +413,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;