aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2014-05-01 05:40:19 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-06 18:14:46 -0400
commit3482124a6a22c631df23958df497f000ba0e1667 (patch)
tree7d7c977c60f7899119c8c54c43a099032e1547cf /tools
parent89ca3b881987f5a4be4c5dbaa7f0df12bbdde2fd (diff)
tools / power: turbostat: Drop temperature checks
The Intel 64 and IA-32 Architectures Software Developer's Manual says that TjMax is stored in bits 23:16 of MSR_TEMPERATURE TARGET (0x1a2). That's 8 bits, not 7, so it must be masked with 0xFF rather than 0x7F. The manual has no mention of which values should be considered valid, which kind of implies that they all are. Arbitrarily discarding values outside a specific range is wrong. The upper range check had to be fixed recently (commit 144b44b1) and the lower range check is just as wrong. See bug #75071: https://bugzilla.kernel.org/show_bug.cgi?id=75071 There are many Xeon processor series with TjMax of 70, 71 or 80 degrees Celsius, way below the arbitrary 85 degrees Celsius limit. There may be other (past or future) models with even lower limits. So drop this arbitrary check. The only value that would be clearly invalid is 0. Everything else should be accepted. After these changes, turbostat is aligned with what the coretemp driver does. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Len Brown <len.brown@intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/x86/turbostat/turbostat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 7c9d8e71eb9e..d0396af99fa0 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1971,13 +1971,13 @@ int set_temperature_target(struct thread_data *t, struct core_data *c, struct pk
1971 if (get_msr(0, MSR_IA32_TEMPERATURE_TARGET, &msr)) 1971 if (get_msr(0, MSR_IA32_TEMPERATURE_TARGET, &msr))
1972 goto guess; 1972 goto guess;
1973 1973
1974 target_c_local = (msr >> 16) & 0x7F; 1974 target_c_local = (msr >> 16) & 0xFF;
1975 1975
1976 if (verbose) 1976 if (verbose)
1977 fprintf(stderr, "cpu%d: MSR_IA32_TEMPERATURE_TARGET: 0x%08llx (%d C)\n", 1977 fprintf(stderr, "cpu%d: MSR_IA32_TEMPERATURE_TARGET: 0x%08llx (%d C)\n",
1978 cpu, msr, target_c_local); 1978 cpu, msr, target_c_local);
1979 1979
1980 if (target_c_local < 85 || target_c_local > 127) 1980 if (!target_c_local)
1981 goto guess; 1981 goto guess;
1982 1982
1983 tcc_activation_temp = target_c_local; 1983 tcc_activation_temp = target_c_local;