[PATCH V3 1/5] ARM: dts: OMAP: Add timer nodes

Hiremath, Vaibhav hvaibhav at ti.com
Fri Oct 26 02:51:29 EST 2012


On Thu, Oct 25, 2012 at 18:03:37, Hunter, Jon wrote:
> 
> On 10/25/2012 07:18 AM, Jon Hunter wrote:
> 
> ...
> 
> >> @@ -113,6 +114,9 @@ static int omap_timer_interrupt_test(struct omap_dm_timer *gptimer)
> >>
> >>         irq_data.gptimer = gptimer;
> >>         init_completion(&irq_data.complete);
> >> +
> >> +       omap_dm_timer_enable(gptimer);
> >> +
> >>         omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
> >>         omap_dm_timer_set_load_start(gptimer, 0, 0xffffff00);
> >>
> >> @@ -128,6 +132,8 @@ static int omap_timer_interrupt_test(struct omap_dm_timer *gptimer)
> >>
> >>         omap_dm_timer_stop(gptimer);
> >>         omap_dm_timer_set_int_enable(gptimer, 0);
> >> +       omap_dm_timer_disable(gptimer);
> >> +
> > 
> > Hmmm ... I am wondering if there is another bug lingering in the dmtimer
> > driver. Ideally, the context should be preserved by the driver.
> 
> Looking at omap_dm_timer_set_load_start() we have the following code to
> restore context ...
> 
> if (!(timer->capability & OMAP_TIMER_ALWON)) {
> 	if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) !=
> 			timer->ctx_loss_count)		
> 		omap_timer_restore_context(timer);
> }
> 
> Can you see if this is getting called for AM33xx for the failing timers?
> If not then it would suggest that we are not detecting context loss
> correctly and not restoring the context. With the above context restore
> code we should not need those extra omap_dm_timer_enable/disable calls.
> 

OK, below log explains all now,

----------------------
Testing 48042000.timer with 24000000 Hz clock ...
omap_dm_timer_set_load_start:559 ctx_loss_count - 0, get_dev_context - 0
Timer read test PASSED! No errors, 100 loops
omap_dm_timer_set_int_enable:665: irq_ena - 0
omap_dm_timer_set_int_enable:671: irq_ena - 2
omap_dm_timer_set_load_start:559 ctx_loss_count - 0, get_dev_context - 0
Timer interrupt test FAILED! No interrupt occurred in 1 sec
omap_dm_timer_set_int_enable:665: irq_ena - 0
omap_dm_timer_set_int_enable:671: irq_ena - 0
Testing 48042000.timer with 32768 Hz clock ...
omap_dm_timer_set_load_start:559 ctx_loss_count - 0, get_dev_context - 0
----------------------


So below condition is not passing for AM33xx which results into context loss.

if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) !=
                                 timer->ctx_loss_count)


Let me debug on this, this looks something specific to am33xx missing from 
baseport.

Thanks,
Vaibhav



More information about the devicetree-discuss mailing list