aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2011-10-11 09:33:51 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2012-03-03 08:40:08 -0500
commitf642089ce0e89931bc2f8484f6ce862536f2b8e9 (patch)
tree87dbc6429ca13f152011bac66dafb272278ed1cf
parent568a89904c7fc93071efd7f811fc58aff6d5774a (diff)
cpupower: AMD fam14h/Ontario monitor can also be used by fam12h cpus
The name of the monitor is updated at runtime to the name of the CPU type. Signed-off-by: Thomas Renninger <trenn@suse.de> CC: Andreas Herrmann <herrmann.der.user@googlemail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--tools/power/cpupower/man/cpupower-monitor.12
-rw-r--r--tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/tools/power/cpupower/man/cpupower-monitor.1 b/tools/power/cpupower/man/cpupower-monitor.1
index d5cfa265c3d3..1141c2073719 100644
--- a/tools/power/cpupower/man/cpupower-monitor.1
+++ b/tools/power/cpupower/man/cpupower-monitor.1
@@ -107,7 +107,7 @@ Deepest package sleep states may in reality show up as machine/platform wide
107sleep states and can only be entered if all cores are idle. Look up Intel 107sleep states and can only be entered if all cores are idle. Look up Intel
108manuals (some are provided in the References section) for further details. 108manuals (some are provided in the References section) for further details.
109 109
110.SS "Ontario" "Liano" 110.SS "Fam_12h" "Fam_14h"
111AMD laptop and desktop processor (family 12h and 14h) sleep state counters. 111AMD laptop and desktop processor (family 12h and 14h) sleep state counters.
112The registers are accessed via PCI and therefore can still be read out while 112The registers are accessed via PCI and therefore can still be read out while
113cores have been offlined. 113cores have been offlined.
diff --git a/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c b/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
index 108108dfa680..2116df9ad832 100644
--- a/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
+++ b/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
@@ -281,13 +281,13 @@ struct cpuidle_monitor *amd_fam14h_register(void)
281 if (cpupower_cpu_info.vendor != X86_VENDOR_AMD) 281 if (cpupower_cpu_info.vendor != X86_VENDOR_AMD)
282 return NULL; 282 return NULL;
283 283
284 if (cpupower_cpu_info.family == 0x14) { 284 if (cpupower_cpu_info.family == 0x14)
285 if (cpu_count <= 0 || cpu_count > 2) { 285 strncpy(amd_fam14h_monitor.name, "Fam_14h",
286 fprintf(stderr, "AMD fam14h: Invalid cpu count: %d\n", 286 MONITOR_NAME_LEN - 1);
287 cpu_count); 287 else if (cpupower_cpu_info.family == 0x12)
288 return NULL; 288 strncpy(amd_fam14h_monitor.name, "Fam_12h",
289 } 289 MONITOR_NAME_LEN - 1);
290 } else 290 else
291 return NULL; 291 return NULL;
292 292
293 /* We do not alloc for nbp1 machine wide counter */ 293 /* We do not alloc for nbp1 machine wide counter */
@@ -322,7 +322,7 @@ static void amd_fam14h_unregister(void)
322} 322}
323 323
324struct cpuidle_monitor amd_fam14h_monitor = { 324struct cpuidle_monitor amd_fam14h_monitor = {
325 .name = "Ontario", 325 .name = "",
326 .hw_states = amd_fam14h_cstates, 326 .hw_states = amd_fam14h_cstates,
327 .hw_states_num = AMD_FAM14H_STATE_NUM, 327 .hw_states_num = AMD_FAM14H_STATE_NUM,
328 .start = amd_fam14h_start, 328 .start = amd_fam14h_start,