ACPI: CPPC: Check present CPUs for determining _CPC is valid
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 24 Dec 2021 01:04:58 +0000 (09:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:51 +0000 (11:04 +0100)
commitd70ce75d1d283953062ca96bd1a6830f4f37443c
treed19bb3dade3f24839909d7d70251eb4e1670d033
parentdd7c1a93025284d244bb5b00108b7417df00e1df
ACPI: CPPC: Check present CPUs for determining _CPC is valid

[ Upstream commit 2aeca6bd02776d7f56a49a32be0dd184f204d888 ]

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 <Jinzhou.Su@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Huang Rui <ray.huang@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