powerpc: Don't do generic calibrate_delay()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 9 Jun 2009 21:12:00 +0000 (21:12 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 15 Jun 2009 03:26:17 +0000 (13:26 +1000)
Currently we are wasting time calling the generic calibrate_delay()
function. We don't need it since our implementation of __delay() is
based on the CPU timebase. So instead, we use our own small
implementation that initializes loops_per_jiffy to something sensible
to make the few users like spinlock debug be happy

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/Kconfig
arch/powerpc/kernel/time.c

index 93a61898b25936f5d0abeef302745f7ca25b91c3..eae0c2bbbf38689259395c13a1d8be8dcb6d1fc6 100644 (file)
@@ -93,10 +93,6 @@ config GENERIC_HWEIGHT
        bool
        default y
 
-config GENERIC_CALIBRATE_DELAY
-       bool
-       default y
-
 config GENERIC_FIND_NEXT_BIT
        bool
        default y
index bee1443da7634d3cf9a062d9223a11d4a63540de..15391c2ab013bc0691228b97076d126fa5dc1aa1 100644 (file)
@@ -52,6 +52,7 @@
 #include <linux/jiffies.h>
 #include <linux/posix-timers.h>
 #include <linux/irq.h>
+#include <linux/delay.h>
 
 #include <asm/io.h>
 #include <asm/processor.h>
@@ -1143,6 +1144,15 @@ void div128_by_32(u64 dividend_high, u64 dividend_low,
 
 }
 
+/* We don't need to calibrate delay, we use the CPU timebase for that */
+void calibrate_delay(void)
+{
+       /* Some generic code (such as spinlock debug) use loops_per_jiffy
+        * as the number of __delay(1) in a jiffy, so make it so
+        */
+       loops_per_jiffy = tb_ticks_per_jiffy;
+}
+
 static int __init rtc_init(void)
 {
        struct platform_device *pdev;