LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Thomas Gleixner <tglx@linutronix.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: Sat, 20 Jan 2007 17:08:27 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.60.0701201655020.4223@poirot.grange> (raw)
In-Reply-To: <1169235221.6271.19.camel@localhost.localdomain>

On Fri, 19 Jan 2007, Thomas Gleixner wrote:

> 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.

The thing is - 2.6.20-rc5-rt3 didn't provide clockevent on PXA, so, I took 
Sascha's patch instead of my own, which I've been using with 2.6.18, as 
his patches were already submitted to various lists and had chances to 
become mainline. And strait away it didn't work. The code above seems to 
be doing something close to Sascha's patch, so, I expect it would behave 
in the same way. And until I introduced a minimum increment for the match 
register, it didn't work. I either got hangs, or WARN_ON dumps about "time 
warp detected". I think, any timer related code for PXA has to be tested 
on real hardware under significant (real-time) load before going upstream. 
Haven't tested -rt7 though, so, maybe it is already handled there?

Thanks
Guennadi
---
Guennadi Liakhovetski

  reply	other threads:[~2007-01-20 16:08 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
2007-01-20 16:08       ` Guennadi Liakhovetski [this message]
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=Pine.LNX.4.60.0701201655020.4223@poirot.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=lfu@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=s.hauer@pengutronix.de \
    --cc=tglx@linutronix.de \
    --subject='Re: [patch 3/3] clockevent driver for arm/pxa2xx' \
    /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

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).