@@ -1071,6 +1071,26 @@ static const struct attribute_group amd_pstate_global_attr_group = {
1071
1071
.attrs = pstate_global_attributes ,
1072
1072
};
1073
1073
1074
+ static bool amd_pstate_acpi_pm_profile_server (void )
1075
+ {
1076
+ switch (acpi_gbl_FADT .preferred_profile ) {
1077
+ case PM_ENTERPRISE_SERVER :
1078
+ case PM_SOHO_SERVER :
1079
+ case PM_PERFORMANCE_SERVER :
1080
+ return true;
1081
+ }
1082
+ return false;
1083
+ }
1084
+
1085
+ static bool amd_pstate_acpi_pm_profile_undefined (void )
1086
+ {
1087
+ if (acpi_gbl_FADT .preferred_profile == PM_UNSPECIFIED )
1088
+ return true;
1089
+ if (acpi_gbl_FADT .preferred_profile >= NR_PM_PROFILES )
1090
+ return true;
1091
+ return false;
1092
+ }
1093
+
1074
1094
static int amd_pstate_epp_cpu_init (struct cpufreq_policy * policy )
1075
1095
{
1076
1096
int min_freq , max_freq , nominal_freq , lowest_nonlinear_freq , ret ;
@@ -1128,10 +1148,14 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
1128
1148
policy -> max = policy -> cpuinfo .max_freq ;
1129
1149
1130
1150
/*
1131
- * Set the policy to powersave to provide a valid fallback value in case
1151
+ * Set the policy to provide a valid fallback value in case
1132
1152
* the default cpufreq governor is neither powersave nor performance.
1133
1153
*/
1134
- policy -> policy = CPUFREQ_POLICY_POWERSAVE ;
1154
+ if (amd_pstate_acpi_pm_profile_server () ||
1155
+ amd_pstate_acpi_pm_profile_undefined ())
1156
+ policy -> policy = CPUFREQ_POLICY_PERFORMANCE ;
1157
+ else
1158
+ policy -> policy = CPUFREQ_POLICY_POWERSAVE ;
1135
1159
1136
1160
if (boot_cpu_has (X86_FEATURE_CPPC )) {
1137
1161
ret = rdmsrl_on_cpu (cpudata -> cpu , MSR_AMD_CPPC_REQ , & value );
0 commit comments