diff options
| author | Tony Lindgren <tony@atomide.com> | 2017-11-28 07:06:34 -0800 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2017-11-28 07:06:34 -0800 |
| commit | 2db57789e6612ce0cf2fcbb577a1c8307b708566 (patch) | |
| tree | dd9f9e3dffabbf5cb932fcf5055ab329ca940fa0 /arch/x86/kernel/cpu/proc.c | |
| parent | f0c96c6d40312b1a76cd36709dc3eb5948c1b97f (diff) | |
| parent | e9a9bb4e4779ca74cb52a6e2f8acbc0881d3bb18 (diff) | |
Merge branch 'soc-fixes' into omap-for-v4.15/fixes
Diffstat (limited to 'arch/x86/kernel/cpu/proc.c')
| -rw-r--r-- | arch/x86/kernel/cpu/proc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 218f79825b3c..e7ecedafa1c8 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c @@ -1,7 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0 #include <linux/smp.h> #include <linux/timex.h> #include <linux/string.h> #include <linux/seq_file.h> +#include <linux/cpufreq.h> + +#include "cpu.h" /* * Get CPU information for use by the procfs. @@ -75,9 +79,16 @@ static int show_cpuinfo(struct seq_file *m, void *v) if (c->microcode) seq_printf(m, "microcode\t: 0x%x\n", c->microcode); - if (cpu_has(c, X86_FEATURE_TSC)) + if (cpu_has(c, X86_FEATURE_TSC)) { + unsigned int freq = aperfmperf_get_khz(cpu); + + if (!freq) + freq = cpufreq_quick_get(cpu); + if (!freq) + freq = cpu_khz; seq_printf(m, "cpu MHz\t\t: %u.%03u\n", - cpu_khz / 1000, (cpu_khz % 1000)); + freq / 1000, (freq % 1000)); + } /* Cache size */ if (c->x86_cache_size >= 0) |
