aboutsummaryrefslogtreecommitdiffstats
path: root/init/calibrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/calibrate.c')
-rw-r--r--init/calibrate.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/init/calibrate.c b/init/calibrate.c
index aae2f40fea4c..24df7976816c 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -9,6 +9,7 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/timex.h> 10#include <linux/timex.h>
11#include <linux/smp.h> 11#include <linux/smp.h>
12#include <linux/percpu.h>
12 13
13unsigned long lpj_fine; 14unsigned long lpj_fine;
14unsigned long preset_lpj; 15unsigned long preset_lpj;
@@ -243,12 +244,19 @@ recalibrate:
243 return lpj; 244 return lpj;
244} 245}
245 246
247static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 };
248
246void __cpuinit calibrate_delay(void) 249void __cpuinit calibrate_delay(void)
247{ 250{
248 unsigned long lpj; 251 unsigned long lpj;
249 static bool printed; 252 static bool printed;
253 int this_cpu = smp_processor_id();
250 254
251 if (preset_lpj) { 255 if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
256 lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
257 pr_info("Calibrating delay loop (skipped) "
258 "already calibrated this CPU");
259 } else if (preset_lpj) {
252 lpj = preset_lpj; 260 lpj = preset_lpj;
253 if (!printed) 261 if (!printed)
254 pr_info("Calibrating delay loop (skipped) " 262 pr_info("Calibrating delay loop (skipped) "
@@ -266,6 +274,7 @@ void __cpuinit calibrate_delay(void)
266 pr_info("Calibrating delay loop... "); 274 pr_info("Calibrating delay loop... ");
267 lpj = calibrate_delay_converge(); 275 lpj = calibrate_delay_converge();
268 } 276 }
277 per_cpu(cpu_loops_per_jiffy, this_cpu) = lpj;
269 if (!printed) 278 if (!printed)
270 pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n", 279 pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
271 lpj/(500000/HZ), 280 lpj/(500000/HZ),