• Rafael J. Wysocki's avatar
    x86: CPU: Fix up "cpu MHz" in /proc/cpuinfo · 941f5f0f
    Rafael J. Wysocki authored
    Commit 890da9cf (Revert "x86: do not use cpufreq_quick_get() for
    /proc/cpuinfo "cpu MHz"") is not sufficient to restore the previous
    behavior of "cpu MHz" in /proc/cpuinfo on x86 due to some changes
    made after the commit it has reverted.
    
    To address this, make the code in question use arch_freq_get_on_cpu()
    which also is used by cpufreq for reporting the current frequency of
    CPUs and since that function doesn't really depend on cpufreq in any
    way, drop the CONFIG_CPU_FREQ dependency for the object file
    containing it.
    
    Also refactor arch_freq_get_on_cpu() somewhat to avoid IPIs and
    return cached values right away if it is called very often over a
    short time (to prevent user space from triggering IPI storms through
    it).
    
    Fixes: 890da9cf (Revert "x86: do not use cpufreq_quick_get() for /proc/cpuinfo "cpu MHz"")
    Cc: stable@kernel.org   # 4.13 - together with 890da9cfSigned-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    941f5f0f
Name
Last commit
Last update
..
alpha Loading commit data...
arc Loading commit data...
arm Loading commit data...
arm64 Loading commit data...
blackfin Loading commit data...
c6x Loading commit data...
cris Loading commit data...
frv Loading commit data...
h8300 Loading commit data...
hexagon Loading commit data...
ia64 Loading commit data...
m32r Loading commit data...
m68k Loading commit data...
metag Loading commit data...
microblaze Loading commit data...
mips Loading commit data...
mn10300 Loading commit data...
nios2 Loading commit data...
openrisc Loading commit data...
parisc Loading commit data...
powerpc Loading commit data...
s390 Loading commit data...
score Loading commit data...
sh Loading commit data...
sparc Loading commit data...
tile Loading commit data...
um Loading commit data...
unicore32 Loading commit data...
x86 Loading commit data...
xtensa Loading commit data...
.gitignore Loading commit data...
Kconfig Loading commit data...