All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org, mingo@elte.hu,
	Luotao Fu <lfu@pengutronix.de>
Subject: Re: [patch 3/3] clockevent driver for arm/pxa2xx
Date: Fri, 19 Jan 2007 20:33:40 +0100	[thread overview]
Message-ID: <1169235221.6271.19.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.60.0701192010490.5127@poirot.grange>

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


	


  reply	other threads:[~2007-01-20 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 10:09 [patch 0/3] clock_event patches for arm systems s.hauer
2007-01-09 10:09 ` [patch 1/3] clockevent driver for arm/imx s.hauer
2007-01-09 10:09 ` [patch 2/3] clockevent driver for arm/netx s.hauer
2007-01-09 10:10 ` [patch 3/3] clockevent driver for arm/pxa2xx s.hauer
2007-01-19 19:13   ` Guennadi Liakhovetski
2007-01-19 19:33     ` Thomas Gleixner [this message]
2007-01-20 16:08       ` Guennadi Liakhovetski
2007-01-20 16:13         ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1169235221.6271.19.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=g.liakhovetski@gmx.de \
    --cc=lfu@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.