Skip to content

Commit 72f2ecb

Browse files
pierregondoisrafaeljw
authored andcommitted
ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported
The _OSC method allows the OS and firmware to communicate about supported features/capabitlities. It also allows the OS to take control of some features. In ACPI 6.4, s6.2.11.2 Platform-Wide OSPM Capabilities, the CPPC (resp. v2) bit should be set by the OS if it 'supports controlling processor performance via the interfaces described in the _CPC object'. The OS supports CPPC and parses the _CPC object only if CONFIG_ACPI_CPPC_LIB is set. Replace the x86 specific boot_cpu_has(X86_FEATURE_HWP) dynamic check with an arch generic CONFIG_ACPI_CPPC_LIB build-time check. Note: CONFIG_X86_INTEL_PSTATE selects CONFIG_ACPI_CPPC_LIB. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0651ab9 commit 72f2ecb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/acpi/bus.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,11 @@ static void acpi_bus_osc_negotiate_platform_control(void)
329329
#endif
330330
#ifdef CONFIG_X86
331331
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT;
332-
if (boot_cpu_has(X86_FEATURE_HWP)) {
333-
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT;
334-
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT;
335-
}
332+
#endif
333+
334+
#ifdef CONFIG_ACPI_CPPC_LIB
335+
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT;
336+
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT;
336337
#endif
337338

338339
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_FLEXIBLE_ADR_SPACE;
@@ -357,10 +358,9 @@ static void acpi_bus_osc_negotiate_platform_control(void)
357358
return;
358359
}
359360

360-
#ifdef CONFIG_X86
361-
if (boot_cpu_has(X86_FEATURE_HWP))
362-
osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &
363-
(OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT));
361+
#ifdef CONFIG_ACPI_CPPC_LIB
362+
osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &
363+
(OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT));
364364
#endif
365365

366366
/*

0 commit comments

Comments
 (0)