Commit 966916eabfb1726fec7ea7b69f0c7f5ce366e943

Authored by ethan zhao
Committed by Rafael J. Wysocki
1 parent 493b4cd285

intel_pstate: skip this driver if Sun server has _PPC method

Oracle Sun X86 servers have dynamic power capping capability that works via
ACPI _PPC method etc, so skip loading this driver if Sun server has ACPI _PPC
enabled.

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Tested-by: Linda Knippers <linda.knippers@hp.com>
Acked-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Showing 1 changed file with 41 additions and 4 deletions Side-by-side Diff

drivers/cpufreq/intel_pstate.c
... ... @@ -1025,15 +1025,46 @@
1025 1025 return true;
1026 1026 }
1027 1027  
  1028 +static bool intel_pstate_has_acpi_ppc(void)
  1029 +{
  1030 + int i;
  1031 +
  1032 + for_each_possible_cpu(i) {
  1033 + struct acpi_processor *pr = per_cpu(processors, i);
  1034 +
  1035 + if (!pr)
  1036 + continue;
  1037 + if (acpi_has_method(pr->handle, "_PPC"))
  1038 + return true;
  1039 + }
  1040 + return false;
  1041 +}
  1042 +
  1043 +enum {
  1044 + PSS,
  1045 + PPC,
  1046 +};
  1047 +
1028 1048 struct hw_vendor_info {
1029 1049 u16 valid;
1030 1050 char oem_id[ACPI_OEM_ID_SIZE];
1031 1051 char oem_table_id[ACPI_OEM_TABLE_ID_SIZE];
  1052 + int oem_pwr_table;
1032 1053 };
1033 1054  
1034 1055 /* Hardware vendor-specific info that has its own power management modes */
1035 1056 static struct hw_vendor_info vendor_info[] = {
1036   - {1, "HP ", "ProLiant"},
  1057 + {1, "HP ", "ProLiant", PSS},
  1058 + {1, "ORACLE", "X4-2 ", PPC},
  1059 + {1, "ORACLE", "X4-2L ", PPC},
  1060 + {1, "ORACLE", "X4-2B ", PPC},
  1061 + {1, "ORACLE", "X3-2 ", PPC},
  1062 + {1, "ORACLE", "X3-2L ", PPC},
  1063 + {1, "ORACLE", "X3-2B ", PPC},
  1064 + {1, "ORACLE", "X4470M2 ", PPC},
  1065 + {1, "ORACLE", "X4270M3 ", PPC},
  1066 + {1, "ORACLE", "X4270M2 ", PPC},
  1067 + {1, "ORACLE", "X4170M2 ", PPC},
1037 1068 {0, "", ""},
1038 1069 };
1039 1070  
1040 1071  
... ... @@ -1057,15 +1088,21 @@
1057 1088  
1058 1089 for (v_info = vendor_info; v_info->valid; v_info++) {
1059 1090 if (!strncmp(hdr.oem_id, v_info->oem_id, ACPI_OEM_ID_SIZE) &&
1060   - !strncmp(hdr.oem_table_id, v_info->oem_table_id, ACPI_OEM_TABLE_ID_SIZE) &&
1061   - intel_pstate_no_acpi_pss())
1062   - return true;
  1091 + !strncmp(hdr.oem_table_id, v_info->oem_table_id,
  1092 + ACPI_OEM_TABLE_ID_SIZE))
  1093 + switch (v_info->oem_pwr_table) {
  1094 + case PSS:
  1095 + return intel_pstate_no_acpi_pss();
  1096 + case PPC:
  1097 + return intel_pstate_has_acpi_ppc();
  1098 + }
1063 1099 }
1064 1100  
1065 1101 return false;
1066 1102 }
1067 1103 #else /* CONFIG_ACPI not enabled */
1068 1104 static inline bool intel_pstate_platform_pwr_mgmt_exists(void) { return false; }
  1105 +static inline bool intel_pstate_has_acpi_ppc(void) { return false; }
1069 1106 #endif /* CONFIG_ACPI */
1070 1107  
1071 1108 static int __init intel_pstate_init(void)