Commit 713beaa02f51ab8c69c13e6a416e1b500363d780
Committed by
Greg Kroah-Hartman
1 parent
95a76bd5fa
Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo"
commit 4bf9636c39ac70da091d5a2e28d3448eaa7f115c upstream. Commit 9fc2105aeaaf ("ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo") breaks audio in python, and probably elsewhere, with message FATAL: cannot locate cpu MHz in /proc/cpuinfo I'm not the first one to hit it, see for example https://theredblacktree.wordpress.com/2014/08/10/fatal-cannot-locate-cpu-mhz-in-proccpuinfo/ https://devtalk.nvidia.com/default/topic/765800/workaround-for-fatal-cannot-locate-cpu-mhz-in-proc-cpuinf/?offset=1 Reading original changelog, I have to say "Stop breaking working setups. You know who you are!". Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 2 changed files with 20 additions and 2 deletions Side-by-side Diff
arch/arm/kernel/setup.c
... | ... | @@ -1043,6 +1043,15 @@ |
1043 | 1043 | seq_printf(m, "model name\t: %s rev %d (%s)\n", |
1044 | 1044 | cpu_name, cpuid & 15, elf_platform); |
1045 | 1045 | |
1046 | +#if defined(CONFIG_SMP) | |
1047 | + seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", | |
1048 | + per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), | |
1049 | + (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); | |
1050 | +#else | |
1051 | + seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", | |
1052 | + loops_per_jiffy / (500000/HZ), | |
1053 | + (loops_per_jiffy / (5000/HZ)) % 100); | |
1054 | +#endif | |
1046 | 1055 | /* dump out the processor features */ |
1047 | 1056 | seq_puts(m, "Features\t: "); |
1048 | 1057 |
arch/arm/kernel/smp.c
... | ... | @@ -387,8 +387,17 @@ |
387 | 387 | |
388 | 388 | void __init smp_cpus_done(unsigned int max_cpus) |
389 | 389 | { |
390 | - printk(KERN_INFO "SMP: Total of %d processors activated.\n", | |
391 | - num_online_cpus()); | |
390 | + int cpu; | |
391 | + unsigned long bogosum = 0; | |
392 | + | |
393 | + for_each_online_cpu(cpu) | |
394 | + bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy; | |
395 | + | |
396 | + printk(KERN_INFO "SMP: Total of %d processors activated " | |
397 | + "(%lu.%02lu BogoMIPS).\n", | |
398 | + num_online_cpus(), | |
399 | + bogosum / (500000/HZ), | |
400 | + (bogosum / (5000/HZ)) % 100); | |
392 | 401 | |
393 | 402 | hyp_mode_check(); |
394 | 403 | } |