Commit 6dd3b8a7 authored by Gautham R. Shenoy's avatar Gautham R. Shenoy Committed by Rafael J. Wysocki
Browse files

ACPI: CPPC: Check _CPC validity for only the online CPUs



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

However the function acpi_cpc_valid() checks for the validity of the
_CPC object for all the present CPUs. This breaks when the kernel is
booted with "nosmt=force".

Hence check the validity of the _CPC objects of only the online CPUs.

Fixes: 2aeca6bd ("ACPI: CPPC: Check present CPUs for determining _CPC is valid")
Reported-by: default avatarChristopher Harris <chris.harris79@gmail.com>
Closes: https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.com/


Suggested-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatar"Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
Tested-by: default avatarChrisopher Harris <chris.harris79@gmail.com>
Signed-off-by: default avatarGautham R. Shenoy <gautham.shenoy@amd.com>
Link: https://patch.msgid.link/20251107074145.2340-3-gautham.shenoy@amd.com


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4fe5934d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ bool acpi_cpc_valid(void)
	if (acpi_disabled)
		return false;

	for_each_present_cpu(cpu) {
	for_each_online_cpu(cpu) {
		cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
		if (!cpc_ptr)
			return false;