diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-09 17:12:00 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-14 23:26:17 -0400 |
commit | 177996e6e20f15004d6757d9b859f57d181ef443 (patch) | |
tree | c5940dd81e7ba4e571d7804a574d73a47e8bef5f | |
parent | 529273c1ad5f591d066a9d90a6bd6affa19c5461 (diff) |
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>
-rw-r--r-- | arch/powerpc/Kconfig | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/time.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 93a61898b259..eae0c2bbbf38 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -93,10 +93,6 @@ config GENERIC_HWEIGHT | |||
93 | bool | 93 | bool |
94 | default y | 94 | default y |
95 | 95 | ||
96 | config GENERIC_CALIBRATE_DELAY | ||
97 | bool | ||
98 | default y | ||
99 | |||
100 | config GENERIC_FIND_NEXT_BIT | 96 | config GENERIC_FIND_NEXT_BIT |
101 | bool | 97 | bool |
102 | default y | 98 | default y |
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 @@ | |||
52 | #include <linux/jiffies.h> | 52 | #include <linux/jiffies.h> |
53 | #include <linux/posix-timers.h> | 53 | #include <linux/posix-timers.h> |
54 | #include <linux/irq.h> | 54 | #include <linux/irq.h> |
55 | #include <linux/delay.h> | ||
55 | 56 | ||
56 | #include <asm/io.h> | 57 | #include <asm/io.h> |
57 | #include <asm/processor.h> | 58 | #include <asm/processor.h> |
@@ -1143,6 +1144,15 @@ void div128_by_32(u64 dividend_high, u64 dividend_low, | |||
1143 | 1144 | ||
1144 | } | 1145 | } |
1145 | 1146 | ||
1147 | /* We don't need to calibrate delay, we use the CPU timebase for that */ | ||
1148 | void calibrate_delay(void) | ||
1149 | { | ||
1150 | /* Some generic code (such as spinlock debug) use loops_per_jiffy | ||
1151 | * as the number of __delay(1) in a jiffy, so make it so | ||
1152 | */ | ||
1153 | loops_per_jiffy = tb_ticks_per_jiffy; | ||
1154 | } | ||
1155 | |||
1146 | static int __init rtc_init(void) | 1156 | static int __init rtc_init(void) |
1147 | { | 1157 | { |
1148 | struct platform_device *pdev; | 1158 | struct platform_device *pdev; |