diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-09 23:12:00 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-15 05:26:17 +0200 |
commit | 177996e6e20f15004d6757d9b859f57d181ef443 (patch) | |
tree | c5940dd81e7ba4e571d7804a574d73a47e8bef5f /arch/powerpc/kernel/time.c | |
parent | powerpc/install: Bail with error code on error in install script (diff) | |
download | linux-177996e6e20f15004d6757d9b859f57d181ef443.tar.xz linux-177996e6e20f15004d6757d9b859f57d181ef443.zip |
powerpc: Don't do generic calibrate_delay()
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>
Diffstat (limited to '')
-rw-r--r-- | arch/powerpc/kernel/time.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index bee1443da763..15391c2ab013 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -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; |