ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported
PATCH v2 1/1 ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported
commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") added support for claiming to support CPPC in _OSC on non-Intel platforms.
This unfortunately caused a regression on a vartiety of AMD platforms in the field because a number of AMD platforms don't set the _OSC bit 5 or 6 to indicate CPPC or CPPC v2 support.
As these AMD platforms already claim CPPC support via a dedicated MSR from X86_FEATURE_CPPC, use that to enable this feature rather than requiring the _OSC on platforms with a dedicated MSR.
If there is additional breakage on the shared memory designs also missing this _OSC, additional follow up changes may be needed.
---v1->v2:
* Make the code easier to follow (suggested by Rafael)
* Update commit message to reflect this is only fixing the MSR case and that any other breakage from 72f2ecb7ece7 will need additional follow ups
drivers/acpi/cppc_acpi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/acpi/cppc_acpi.c +9 -4
@@ -629,7 +629,15 @@ static bool is_cppc_supported(int revision, int num_ent)return false; } -return true; +if (!osc_sb_cppc_not_supported) +return true; + +pr_debug ("Firmware missing _OSC support\n" ); +#ifdef CONFIG_X86 +return boot_cpu_has (X86_FEATURE_CPPC ); +#else +return false; +#endif }/*
@@ -684,9 +692,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)acpi_status status;int ret = -ENODATA ; -if (osc_sb_cppc_not_supported) -return -ENODEV ; -/* Parse the ACPI _CPC table for this CPU. */ status =acpi_evaluate_object_typed (handle,"_CPC" ,NULL , &output,ACPI_TYPE_PACKAGE );
Signature · 1 line
2.25.1
Rafael J. Wysocki
maintainerQuoted 13 lines · Mario Limonciello
commit
72f2ecb7ece7("ACPI: bus: Set CPPC_OSCbits for all and whenCPPC_LIBis supported") added support for claiming to support CPPC in_OSCon non-Intel platforms.This unfortunately caused a regression on a vartiety of AMD platforms in the field because a number of AMD platforms don't set the
_OSCbit 5 or 6 to indicate CPPC or CPPC v2 support.As these AMD platforms already claim CPPC support via a dedicated MSR from
X86_FEATURE_CPPC, use that to enable this feature rather than requiring the_OSCon platforms with a dedicated MSR.
Quoted 6 lines
If there is additional breakage on the shared memory designs also missing this
_OSC, additional follow up changes may be needed.Fixes 72f2ecb7ece7 ("Set CPPC _OSC bits for all and when CPPC_LIB is supported")Reported-by Perry Yuan <[email protected]>Signed-off-by Mario Limonciello <[email protected]>
I'm still concerned about the possible cases in which there is _CPC, but it returns garbage, because the firmware thinks that the OS will not use _CPC due to the _OSC handshake.
Quoted 14 lines
---
v1->v2:
* Make the code easier to follow (suggested by Rafael)
* Update commit message to reflect this is only fixing the MSR case and that any other breakage from72f2ecb7ece7will need additional follow upsdrivers/acpi/cppc_acpi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)drivers/acpi/cppc_acpi.c +0
-0
drivers/acpi/cppc_acpi.c static bool is_cppc_supported(int revision, int num_ent) · line 637
Quoted 10 lines
drivers/acpi/cppc_acpi.c +6
-1@@ -629,7 +629,15 @@ static bool is_cppc_supported(int revision, int num_ent)return false; } -return true; +if (!osc_sb_cppc_not_supported) +return true; + +pr_debug ("Firmware missing _OSC support\n" ); +#ifdef CONFIG_X86 +return boot_cpu_has (X86_FEATURE_CPPC );
So can you please add an additional X86_VENDOR_AMD check to the above?
Quoted 19 lines
drivers/acpi/cppc_acpi.c +3
-4+#else +return false; +#endif }/* @@ -684,9 +692,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)acpi_status status;int ret = -ENODATA ; -if (osc_sb_cppc_not_supported) -return -ENODEV ; -/* Parse the ACPI _CPC table for this CPU. */ status =acpi_evaluate_object_typed (handle,"_CPC" ,NULL , &output,ACPI_TYPE_PACKAGE ); --2.25.1
[Public]
Quoted 57 lines
-----Original Message-----
From: Rafael J. Wysocki <[email protected]>
Sent: Tuesday, July 5, 2022 13:12
To: Limonciello, Mario <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>; Len Brown <[email protected]>; Sudeep Holla <[email protected]>; Pierre Gondois <[email protected]>; Yuan, Perry <[email protected]>; ACPI Devel Maling List <[email protected]>; Linux Kernel Mailing List <[email protected]>
Subject: Re: [PATCH v2] ACPI: CPPC: Don't require_OSCifX86_FEATURE_CPPCis supportedQuoted 9 lines · Mario Limonciello
commit
72f2ecb7ece7("ACPI: bus: Set CPPC_OSCbits for all and whenCPPC_LIBis supported") added support for claiming to support CPPC in_OSCon non-Intel platforms.This unfortunately caused a regression on a vartiety of AMD platforms in the field because a number of AMD platforms don't set the
_OSCbit 5 or 6 to indicate CPPC or CPPC v2 support.Quoted 8 lines
As these AMD platforms already claim CPPC support via a dedicated MSR from
X86_FEATURE_CPPC, use that to enable this feature rather than requiring the_OSCon platforms with a dedicated MSR.If there is additional breakage on the shared memory designs also missing this
_OSC, additional follow up changes may be needed.Fixes 72f2ecb7ece7 ("Set CPPC _OSC bits for all and when CPPC_LIB issupported")
Quoted 2 lines
Reported-by Perry Yuan <[email protected]>Signed-off-by Mario Limonciello <[email protected]>I'm still concerned about the possible cases in which there is
_CPC, but it returns garbage, because the firmware thinks that the OS will not use_CPCdue to the_OSChandshake.drivers/acpi/cppc_acpi.c static bool is_cppc_supported(int revision, int
Quoted 14 lines
---
v1->v2:
* Make the code easier to follow (suggested by Rafael)
* Update commit message to reflect this is only fixing the MSR case and that any other breakage from72f2ecb7ece7will need additional follow upsdrivers/acpi/cppc_acpi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)drivers/acpi/cppc_acpi.c +0
-0@@ -629,7 +629,15 @@ static bool is_cppc_supported(int revision, int
num_ent)Quoted 3 lines
drivers/acpi/cppc_acpi.c +0
-0return false; }
Quoted 9 lines
drivers/acpi/cppc_acpi.c static bool is_cppc_supported(int revision, int num_ent) · line 637
Quoted 7 lines
drivers/acpi/cppc_acpi.c +6
-1-return true; +if (!osc_sb_cppc_not_supported) +return true; + +pr_debug ("Firmware missing _OSC support\n" ); +#ifdef CONFIG_X86 +return boot_cpu_has (X86_FEATURE_CPPC );So can you please add an additional
X86_VENDOR_AMDcheck to the above?
Very well, I'll send out v4 shortly with that modification.
Quoted 21 lines
drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct
Quoted 8 lines
drivers/acpi/cppc_acpi.c +3
-0+#else +return false; +#endif }/* @@ -684,9 +692,6 @@ int acpi_cppc_processor_probe(struct
acpi_processor*pr)Quoted 12 lines
drivers/acpi/cppc_acpi.c +0
-4acpi_status status;int ret = -ENODATA ; -if (osc_sb_cppc_not_supported) -return -ENODEV ; -/* Parse the ACPI _CPC table for this CPU. */ status =acpi_evaluate_object_typed (handle,"_CPC" ,NULL , &output,ACPI_TYPE_PACKAGE ); --2.25.1