diff options
author | Aaro Koskinen <Aaro.Koskinen@nokia.com> | 2009-01-29 11:57:17 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-01-29 12:27:00 -0500 |
commit | df88acbbdc48d0bfe2a46bf2561d984b6d87a9ac (patch) | |
tree | b171f17a12cac4b5ee98e8a98b019857ba70dc0b | |
parent | 0dffb5c57a1d76532e2f2c7398579bfce81c3e5c (diff) |
ARM: OMAP: gptimer min_delta_ns corrected
When 32 kHz timer is used the min_delta_ns should be initialized so
that it reflects the timer programming cost. A write to the timer
device will be usually posted, but it takes roughly 3 cycles before
it is effective. If the timer is reprogrammed before that, the CPU
will stall until the previous write completes. This was pointed out by
Richard Woodruff.
Since the lower bound for min_delta_ns is 1000, the change is visible
only with tick rates less than 3 MHz.
Also note that the old value is incorrect for 32 kHz also due to
a rounding error, and it can cause the timer queue to hang (due to
clockevent code trying to program the timer with zero ticks).
Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com>
Reviewed-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/timer-gp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index ae6036300f60..9fc13a2cc3f4 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
@@ -118,7 +118,8 @@ static void __init omap2_gp_clockevent_init(void) | |||
118 | clockevent_gpt.max_delta_ns = | 118 | clockevent_gpt.max_delta_ns = |
119 | clockevent_delta2ns(0xffffffff, &clockevent_gpt); | 119 | clockevent_delta2ns(0xffffffff, &clockevent_gpt); |
120 | clockevent_gpt.min_delta_ns = | 120 | clockevent_gpt.min_delta_ns = |
121 | clockevent_delta2ns(1, &clockevent_gpt); | 121 | clockevent_delta2ns(3, &clockevent_gpt); |
122 | /* Timer internal resynch latency. */ | ||
122 | 123 | ||
123 | clockevent_gpt.cpumask = cpumask_of(0); | 124 | clockevent_gpt.cpumask = cpumask_of(0); |
124 | clockevents_register_device(&clockevent_gpt); | 125 | clockevents_register_device(&clockevent_gpt); |