Skip to content

Commit 45852ee

Browse files
committed
ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2164217 Conflicts: drivers/acpi/bus.c - minor conflict differences in removing the osc_sb_cppc_not_supported assignment, but since upstream completely removed the assignment I did the same. commit 7feec74 Author: Mario Limonciello <mario.limonciello@amd.com> Date: Tue Jul 5 13:29:14 2022 -0500 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 <cuihao.leo@gmail.com> Reported-by: maxim.novozhilov@gmail.com Reported-by: lethe.tree@protonmail.com Reported-by: garystephenwright@gmail.com Reported-by: galaxyking0419@gmail.com 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 <mika.westerberg@linux.intel.com> Tested-by: CUI Hao <cuihao.leo@gmail.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 22e8a0a commit 45852ee

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

drivers/acpi/bus.c

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

300-
bool osc_sb_cppc_not_supported;
300+
bool osc_sb_cppc2_support_acked;
301301

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

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

377371
capbuf_ret = context.ret.pointer;
378372
if (context.ret.length > OSC_SUPPORT_DWORD) {
373+
#ifdef CONFIG_ACPI_CPPC_LIB
374+
osc_sb_cppc2_support_acked = capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CPCV2_SUPPORT;
375+
#endif
376+
379377
osc_sb_apei_support_acked =
380378
capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
381379
osc_pc_lpi_support_confirmed =

drivers/acpi/cppc_acpi.c

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

676-
if (osc_sb_cppc_not_supported)
676+
if (!osc_sb_cppc2_support_acked) {
677+
pr_debug("CPPC v2 _OSC not acked\n");
677678
return -ENODEV;
679+
}
678680

679681
/* Parse the ACPI _CPC table for this CPU. */
680682
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
@@ -585,7 +585,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
585585
extern bool osc_sb_apei_support_acked;
586586
extern bool osc_pc_lpi_support_confirmed;
587587
extern bool osc_sb_native_usb4_support_confirmed;
588-
extern bool osc_sb_cppc_not_supported;
588+
extern bool osc_sb_cppc2_support_acked;
589589
extern bool osc_cpc_flexible_adr_space_confirmed;
590590

591591
/* USB4 Capabilities */

0 commit comments

Comments
 (0)