* [PATCH] omap: timer: Set dmtimer used as clocksource in autoreload mode
@ 2011-08-10 3:52 Hemant Pedanekar
2011-08-10 11:51 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Hemant Pedanekar @ 2011-08-10 3:52 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
arch/arm/mach-omap2/timer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index e964072..796b935 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -293,7 +293,7 @@ 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_set_load_start(&clksrc, 1, 0);
init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate);
if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
--
1.7.3.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] omap: timer: Set dmtimer used as clocksource in autoreload mode
2011-08-10 3:52 [PATCH] omap: timer: Set dmtimer used as clocksource in autoreload mode Hemant Pedanekar
@ 2011-08-10 11:51 ` Tony Lindgren
2011-08-10 12:25 ` Pedanekar, Hemant
0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2011-08-10 11:51 UTC (permalink / raw)
To: linux-arm-kernel
* Hemant Pedanekar <hemantp@ti.com> [110809 20:46]:
> 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>
> ---
> arch/arm/mach-omap2/timer.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index e964072..796b935 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -293,7 +293,7 @@ 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_set_load_start(&clksrc, 1, 0);
> init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate);
>
> if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
You should be able to just set the autoreload mode by changing to use
OMAP_TIMER_CTRL_POSTED | OMAP_TIMER_CTRL_AR in the __omap_dm_timer_load_start
above.
This avoids calling something that might be a loadable module eventually.
Regards,
Tony
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] omap: timer: Set dmtimer used as clocksource in autoreload mode
2011-08-10 11:51 ` Tony Lindgren
@ 2011-08-10 12:25 ` Pedanekar, Hemant
0 siblings, 0 replies; 3+ messages in thread
From: Pedanekar, Hemant @ 2011-08-10 12:25 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren wrote on Wednesday, August 10, 2011 5:21 PM:
> * Hemant Pedanekar <hemantp@ti.com> [110809 20:46]:
>> 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>
>> ---
>> arch/arm/mach-omap2/timer.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
>> index e964072..796b935 100644 --- a/arch/arm/mach-omap2/timer.c
>> +++ b/arch/arm/mach-omap2/timer.c
>> @@ -293,7 +293,7 @@ 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_set_load_start(&clksrc, 1, 0);
>> init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate);
>>
>> if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
>
> You should be able to just set the autoreload mode by changing to use
> OMAP_TIMER_CTRL_POSTED | OMAP_TIMER_CTRL_AR in the
> __omap_dm_timer_load_start
> above.
>
> This avoids calling something that might be a loadable module eventually.
>
> Regards,
>
> Tony
Yes, that would be better - I didn't think about loadable module option.
Thanks.
Hemant
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-10 12:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-10 3:52 [PATCH] omap: timer: Set dmtimer used as clocksource in autoreload mode Hemant Pedanekar
2011-08-10 11:51 ` Tony Lindgren
2011-08-10 12:25 ` Pedanekar, Hemant
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).