Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-3.10.git] / init / calibrate.c
index 24df797..fda0a7b 100644 (file)
@@ -246,6 +246,19 @@ recalibrate:
 
 static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 };
 
+/*
+ * Check if cpu calibration delay is already known. For example,
+ * some processors with multi-core sockets may have all cores
+ * with the same calibration delay.
+ *
+ * Architectures should override this function if a faster calibration
+ * method is available.
+ */
+unsigned long __attribute__((weak)) __cpuinit calibrate_delay_is_known(void)
+{
+       return 0;
+}
+
 void __cpuinit calibrate_delay(void)
 {
        unsigned long lpj;
@@ -254,7 +267,8 @@ void __cpuinit calibrate_delay(void)
 
        if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
                lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
-               pr_info("Calibrating delay loop (skipped) "
+               if (!printed)
+                       pr_info("Calibrating delay loop (skipped) "
                                "already calibrated this CPU");
        } else if (preset_lpj) {
                lpj = preset_lpj;
@@ -265,6 +279,8 @@ void __cpuinit calibrate_delay(void)
                lpj = lpj_fine;
                pr_info("Calibrating delay loop (skipped), "
                        "value calculated using timer frequency.. ");
+       } else if ((lpj = calibrate_delay_is_known())) {
+               ;
        } else if ((lpj = calibrate_delay_direct()) != 0) {
                if (!printed)
                        pr_info("Calibrating delay using timer "