diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-02 17:06:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-02 17:06:32 -0400 |
commit | 890da9cf098364b11a7f7f5c22fa652531624d03 (patch) | |
tree | b878f52fba42a88cffe73a49acfffa1cea7f577b | |
parent | 6daa0839235df0d8933b7d72aee2b956b72d3c1b (diff) |
Revert "x86: do not use cpufreq_quick_get() for /proc/cpuinfo "cpu MHz""
This reverts commit 51204e0639c49ada02fd823782ad673b6326d748.
There wasn't really any good reason for it, and people are complaining
(rightly) that it broke existing practice.
Cc: Len Brown <len.brown@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/kernel/cpu/proc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 5455f3b8b969..6b7e17bf0b71 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/timex.h> | 3 | #include <linux/timex.h> |
4 | #include <linux/string.h> | 4 | #include <linux/string.h> |
5 | #include <linux/seq_file.h> | 5 | #include <linux/seq_file.h> |
6 | #include <linux/cpufreq.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Get CPU information for use by the procfs. | 9 | * Get CPU information for use by the procfs. |
@@ -76,9 +77,14 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
76 | if (c->microcode) | 77 | if (c->microcode) |
77 | seq_printf(m, "microcode\t: 0x%x\n", c->microcode); | 78 | seq_printf(m, "microcode\t: 0x%x\n", c->microcode); |
78 | 79 | ||
79 | if (cpu_has(c, X86_FEATURE_TSC)) | 80 | if (cpu_has(c, X86_FEATURE_TSC)) { |
81 | unsigned int freq = cpufreq_quick_get(cpu); | ||
82 | |||
83 | if (!freq) | ||
84 | freq = cpu_khz; | ||
80 | seq_printf(m, "cpu MHz\t\t: %u.%03u\n", | 85 | seq_printf(m, "cpu MHz\t\t: %u.%03u\n", |
81 | cpu_khz / 1000, (cpu_khz % 1000)); | 86 | freq / 1000, (freq % 1000)); |
87 | } | ||
82 | 88 | ||
83 | /* Cache size */ | 89 | /* Cache size */ |
84 | if (c->x86_cache_size >= 0) | 90 | if (c->x86_cache_size >= 0) |