Skip to content

Commit

Permalink
omap: timer: Set dmtimer used as clocksource in autoreload mode
Browse files Browse the repository at this point in the history
If CONFIG_OMAP_32K_TIMER is not selected and dmtimer is used as clocksource, the
timer stops counting once overflow occurs as it was not set in autoreload mode.
This results into timekeeping failure: for example, 'sleep 1' at the shell after
the timer counter overflow would hang.

This patch sets up autoreload when starting the clocksource timer which fixes
the above issue.

Signed-off-by: Hemant Pedanekar <hemantp@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Hemant Pedanekar authored and Tony Lindgren committed Aug 10, 2011
1 parent 133e6b5 commit e9d0b97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ static void __init omap2_gp_clocksource_init(int gptimer_id,
pr_info("OMAP clocksource: GPTIMER%d at %lu Hz\n",
gptimer_id, clksrc.rate);

__omap_dm_timer_load_start(clksrc.io_base, OMAP_TIMER_CTRL_ST, 0, 1);
__omap_dm_timer_load_start(clksrc.io_base,
OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1);
init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate);

if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
Expand Down

0 comments on commit e9d0b97

Please sign in to comment.