public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert 9fc2105aeaaf56b0cf75296a84702d0f9e64437b to fix pyaudio (and probably more)
@ 2015-01-04 19:01 Pavel Machek
  2015-01-04 20:03 ` Nicolas Pitre
  0 siblings, 1 reply; 66+ messages in thread
From: Pavel Machek @ 2015-01-04 19:01 UTC (permalink / raw)
  To: nico, marc.zyngier, rmk+kernel, Linus Torvalds, kernel list

9fc2105aeaaf56b0cf75296a84702d0f9e64437b 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>

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index ff6760a..940779c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1048,6 +1048,15 @@ static int c_show(struct seq_file *m, void *v)
 		seq_printf(m, "model name\t: %s rev %d (%s)\n",
 			   cpu_name, cpuid & 15, elf_platform);
 
+#if defined(CONFIG_SMP)
+		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
+			   per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
+			   (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
+#else
+		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
+			   loops_per_jiffy / (500000/HZ),
+			   (loops_per_jiffy / (5000/HZ)) % 100);
+#endif
 		/* dump out the processor features */
 		seq_puts(m, "Features\t: ");
 
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 5e6052e..86ef244 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -387,6 +387,18 @@ asmlinkage void secondary_start_kernel(void)
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
+	int cpu;
+	unsigned long bogosum = 0;
+
+	for_each_online_cpu(cpu)
+		bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
+
+	printk(KERN_INFO "SMP: Total of %d processors activated "
+	       "(%lu.%02lu BogoMIPS).\n",
+	       num_online_cpus(),
+	       bogosum / (500000/HZ),
+	       (bogosum / (5000/HZ)) % 100);
+
 	hyp_mode_check();
 }
 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2015-01-09 22:54 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-04 19:01 [PATCH] Revert 9fc2105aeaaf56b0cf75296a84702d0f9e64437b to fix pyaudio (and probably more) Pavel Machek
2015-01-04 20:03 ` Nicolas Pitre
2015-01-04 20:10   ` Pavel Machek
2015-01-04 20:25     ` Nicolas Pitre
2015-01-04 20:37       ` Pavel Machek
2015-01-04 20:56         ` Nicolas Pitre
2015-01-04 21:02           ` Linus Torvalds
2015-01-04 21:20             ` Nicolas Pitre
2015-01-04 21:26               ` Russell King - ARM Linux
2015-01-04 21:40                 ` Pavel Machek
2015-01-04 22:27                   ` Aaro Koskinen
2015-01-05  1:34                 ` Theodore Ts'o
2015-01-05 12:32                   ` Will Deacon
2015-01-05  4:51                 ` Nicolas Pitre
2015-01-05 12:11                   ` Will Deacon
2015-01-05 15:34                     ` Pavel Machek
2015-01-05 16:24                     ` Nicolas Pitre
2015-01-07 18:11                   ` Catalin Marinas
2015-01-07 18:47                     ` Linus Torvalds
2015-01-07 19:00                       ` Nicolas Pitre
2015-01-07 19:36                         ` Linus Torvalds
2015-01-07 20:34                           ` Nicolas Pitre
2015-01-07 20:53                             ` Russell King - ARM Linux
2015-01-07 21:15                               ` Nicolas Pitre
2015-01-09 22:54                                 ` Steven Rostedt
2015-01-07 22:14                               ` Catalin Marinas
2015-01-08  0:05                                 ` Linus Torvalds
2015-01-08  0:45                                   ` Nicolas Pitre
2015-01-08  0:57                                     ` Linus Torvalds
2015-01-08  4:56                                       ` Nicolas Pitre
2015-01-08  5:04                                         ` Linus Torvalds
2015-01-08  5:54                                           ` Nicolas Pitre
2015-01-08 10:39                                 ` Russell King - ARM Linux
2015-01-08 15:44                                   ` Vince Weaver
2015-01-08 16:19                                     ` Catalin Marinas
2015-01-08 16:34                                       ` Russell King - ARM Linux
2015-01-08 16:41                                         ` Catalin Marinas
2015-01-08 16:57                                           ` Russell King - ARM Linux
2015-01-08 17:01                                             ` Catalin Marinas
2015-01-08 17:39                                               ` Vince Weaver
2015-01-08 17:22                                             ` Vince Weaver
2015-01-08 22:46                                             ` Pavel Machek
2015-01-09  9:49                                               ` Catalin Marinas
2015-01-08 16:32                                     ` Russell King - ARM Linux
     [not found]                             ` <CA+55aFwuO2g1S-bY96V28crMWj+dKXWANzbP28JQjBdTg0rV0w@mail.gmail.com>
2015-01-07 21:29                               ` Nicolas Pitre
     [not found]                                 ` <CA+55aFyrNE9qqBR9Khbj=TuAnjA+UzUhNxFz==SqKuiG5q3uMQ@mail.gmail.com>
2015-01-07 22:42                                   ` Nicolas Pitre
2015-01-08  0:25                                     ` Linus Torvalds
2015-01-08  0:49                                       ` Linus Torvalds
2015-01-07 22:24                           ` Catalin Marinas
2015-01-07 18:50                     ` Nicolas Pitre
2015-01-08 22:49                   ` Pavel Machek
2015-01-06 18:33         ` Will Deacon
2015-01-04 20:22   ` Linus Torvalds
2015-01-04 20:43     ` Russell King - ARM Linux
2015-01-04 20:52       ` Pavel Machek
2015-01-04 20:45     ` Nicolas Pitre
2015-01-04 20:57       ` Linus Torvalds
2015-01-04 21:15         ` Russell King - ARM Linux
2015-01-05 14:22           ` One Thousand Gnomes
2015-01-05 18:22             ` Catalin Marinas
2015-01-06 22:33               ` Linus Torvalds
2015-01-06 23:42                 ` Catalin Marinas
2015-01-07  1:20                   ` Linus Torvalds
2015-01-07 15:01                     ` Catalin Marinas
2015-01-08 13:29                       ` One Thousand Gnomes
2015-01-07  6:41                   ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox