lkml.org 
[lkml]   [2007]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 3/3] clockevent driver for arm/pxa2xx
From
Date
On Fri, 2007-01-19 at 20:13 +0100, Guennadi Liakhovetski wrote:
> > +static u32 clockevent_mode = 0;
> > +
> > +static void pxa_set_next_event(unsigned long evt,
> > + struct clock_event_device *unused)
> > +{
> > + OSMR0 = OSCR + evt;
> > +}
>
> This doesn't work for me in various nasty ways. Please, check for a
> minimum delay or loop to get ahead of time. See code in the "old" timer
> ISR. See how it unconditionally adds at least 10 ticks...

I added support for match register based devices and you want to do
something like this:

static int hpet_next_event(unsigned long delta,
struct clock_event_device *evt)
{
unsigned long cnt;

cnt = hpet_readl(HPET_COUNTER);
cnt += delta;
hpet_writel(cnt, HPET_T0_CMP);

return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0);
}

The generic code takes care of the already expired event.

tglx




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-20 17:43    [W:0.261 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site