Skip to content

Commit 7feec74

Browse files
superm1rafaeljw
authored andcommitted
ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked
Previously the kernel used to ignore whether the firmware masked CPPC or CPPCv2 and would just pretend that it worked. When support for the USB4 bit in _OSC was introduced from commit 9e1f561afb ("ACPI: Execute platform _OSC also with query bit clear") the kernel began to look at the return when the query bit was clear. This caused regressions that were misdiagnosed and attempted to be solved as part of commit 2ca8e62 ("Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag""). This caused a different regression where non-Intel systems weren't able to negotiate _OSC properly. This was reverted in commit 2ca8e62 ("Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag"") and attempted to be fixed by commit c42fa24 ("ACPI: bus: Avoid using CPPC if not supported by firmware") but the regression still returned. These systems with the regression only load support for CPPC from an SSDT dynamically when _OSC reports CPPC v2. Avoid the problem by not letting CPPC satisfy the requirement in `acpi_cppc_processor_probe`. Reported-by: CUI Hao <[email protected]> Reported-by: [email protected] Reported-by: [email protected] Reported-by: [email protected] Reported-by: [email protected] Fixes: c42fa24 ("ACPI: bus: Avoid using CPPC if not supported by firmware") Fixes: 2ca8e62 ("Revert "ACPI Pass the same capabilities to the _OSC regardless of the query flag"") Link: https://bugzilla.kernel.org/show_bug.cgi?id=213023 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2075387 Reviewed-by: Mika Westerberg <[email protected]> Tested-by: CUI Hao <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 88084a3 commit 7feec74

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

drivers/acpi/bus.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ EXPORT_SYMBOL_GPL(osc_cpc_flexible_adr_space_confirmed);
298298
bool osc_sb_native_usb4_support_confirmed;
299299
EXPORT_SYMBOL_GPL(osc_sb_native_usb4_support_confirmed);
300300

301-
bool osc_sb_cppc_not_supported;
301+
bool osc_sb_cppc2_support_acked;
302302

303303
static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
304304
static void acpi_bus_osc_negotiate_platform_control(void)
@@ -358,11 +358,6 @@ static void acpi_bus_osc_negotiate_platform_control(void)
358358
return;
359359
}
360360

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));
364-
#endif
365-
366361
/*
367362
* Now run _OSC again with query flag clear and with the caps
368363
* supported by both the OS and the platform.
@@ -376,6 +371,10 @@ static void acpi_bus_osc_negotiate_platform_control(void)
376371

377372
capbuf_ret = context.ret.pointer;
378373
if (context.ret.length > OSC_SUPPORT_DWORD) {
374+
#ifdef CONFIG_ACPI_CPPC_LIB
375+
osc_sb_cppc2_support_acked = capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CPCV2_SUPPORT;
376+
#endif
377+
379378
osc_sb_apei_support_acked =
380379
capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
381380
osc_pc_lpi_support_confirmed =

drivers/acpi/cppc_acpi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
684684
acpi_status status;
685685
int ret = -ENODATA;
686686

687-
if (osc_sb_cppc_not_supported)
687+
if (!osc_sb_cppc2_support_acked) {
688+
pr_debug("CPPC v2 _OSC not acked\n");
688689
return -ENODEV;
690+
}
689691

690692
/* Parse the ACPI _CPC table for this CPU. */
691693
status = acpi_evaluate_object_typed(handle, "_CPC", NULL, &output,

include/linux/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
584584
extern bool osc_sb_apei_support_acked;
585585
extern bool osc_pc_lpi_support_confirmed;
586586
extern bool osc_sb_native_usb4_support_confirmed;
587-
extern bool osc_sb_cppc_not_supported;
587+
extern bool osc_sb_cppc2_support_acked;
588588
extern bool osc_cpc_flexible_adr_space_confirmed;
589589

590590
/* USB4 Capabilities */

0 commit comments

Comments
 (0)