Re: [Regression] 6.11.0-rc1: AMD CPU boot with error when CPPC feature disabled by BIOS

From: David Wang
Date: Wed Jul 31 2024 - 00:34:51 EST


At 2024-07-31 12:21:05, "Xiaojian Du" <xiaojidu@xxxxxxx> wrote:
>
>On 2024/7/31 11:39, David Wang wrote:
>> At 2024-07-31 11:16:14, "Xiaojian Du" <xiaojidu@xxxxxxx> wrote:
>>> On 2024/7/31 8:25, David Wang wrote:
>>>> Hi Du,
>>>>
>>>> Thanks for the quick response
>>>>
>>>> ...
>>>> I feel that you are arguing for the warning and the errors separately.
>>>> Separately, I agree warning or error message make sense as you explained, but together I feel confused:
>>>> Receiving a warning that CPPC feature is disable by BIOS already notify users that amd-pstate would not work, right?
>Warning is not enough, error will guide user to switch to acpi cpu
>driver or seek more support from OEM.
>>>> Is it possible, that those two condition coexists: CPPC is disabled by BIOS, and amd-pstate could function properly?
>>>>
>>>>
>
>No possible, the current amd-pstate driver is based on CPPC feature.
>
>Thanks.
>Xiaojian
>

So, what about the patch I mentioned: when CPPC is disabled by BIOS, print warning message and abort amd-pstate driver registration?
(I made a code block mistake in the patch I posted before)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 68c616b572f2..b06faea58fd4 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1837,8 +1837,6 @@ static bool amd_cppc_supported(void)
* If the CPPC feature is disabled in the BIOS for processors that support MSR-based CPPC,
* the AMD Pstate driver may not function correctly.
* Check the CPPC flag and display a warning message if the platform supports CPPC.
- * Note: below checking code will not abort the driver registeration process because of
- * the code is added for debugging purposes.
*/
if (!cpu_feature_enabled(X86_FEATURE_CPPC)) {
if (cpu_feature_enabled(X86_FEATURE_ZEN1) || cpu_feature_enabled(X86_FEATURE_ZEN2)) {
@@ -1856,6 +1854,7 @@ static bool amd_cppc_supported(void)
- if (warn)
+ if (warn) {
pr_warn_once("The CPPC feature is supported but currently disabled by the BIOS.\n"
"Please enable it if your BIOS has the CPPC option.\n");
+ return false;
+ }
return true;
}



Thanks
David