[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RTC_PIE possible using via-pmu?



On Wed, Mar 30, 2005 at 10:36:15AM +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2005-03-29 at 13:17 +0100, Martin Habets wrote:
> > RTC_IRQP_SET sets the periodic interrupt rate.
> > RTC_PIE_ON turns on periodic interrupts.
> > RTC_PIE_OFF turns off periodic interrupts.
> > 
> > There are similar ioctls for setting alarms, but I don't see those
> > used very often.
> > 
> > I've pasted the relevant part of my dmesg below. It seems the OpenPIC
> > timer frequency will limit the usability of above iotctls to 4.16MHz.
> > Is that right?
> 
> Oh, those periodic interrupt things are features of x86 RTC chips, they
> aren't available on other architectures, at least not all of them,
> definitely not on pmac.

Well I was wondering if I could use the via-pmu timer to implement such
a periodic interrupt.

> Why not just normal timers ?

Not sure what exactly you mean by "normal". I created a genrtc patch [1] for
the ioctls above using add_timer().
But the resulting timer responses using a simple test program [2] are not
that good (the last percentage is the accuracy), and above 1024Hz completely
unusable:

$ ./rtctest2
20 loops at 2Hz = 9997669 usec, 499883 usec/loop. deviation is 117 usec (0%).
20 loops at 4Hz = 4999186 usec, 249959 usec/loop. deviation is 41 usec (0%).
20 loops at 8Hz = 2499566 usec, 124978 usec/loop. deviation is 22 usec (0%).
20 loops at 16Hz = 1239760 usec, 61988 usec/loop. deviation is 512 usec (0%).
20 loops at 32Hz = 619856 usec, 30992 usec/loop. deviation is 258 usec (0%).
20 loops at 64Hz = 299902 usec, 14995 usec/loop. deviation is 630 usec (4%).
20 loops at 128Hz = 139931 usec, 6996 usec/loop. deviation is 816 usec (10%).
20 loops at 256Hz = 59947 usec, 2997 usec/loop. deviation is 909 usec (23%).
20 loops at 512Hz = 21003 usec, 1050 usec/loop. deviation is 903 usec (46%).
20 loops at 1024Hz = 19906 usec, 995 usec/loop. deviation is 19 usec (1%).
20 loops at 2048Hz = 19954 usec, 997 usec/loop. deviation is 509 usec (104%).
20 loops at 4096Hz = 19955 usec, 997 usec/loop. deviation is 753 usec (308%).
20 loops at 8192Hz = 19956 usec, 997 usec/loop. deviation is 875 usec (717%).

Oddly enough (well, odd to me :), 1024Hz is quite good. I have been able
to do some latency tests with that setting [3] which point to latency issues
with the radeon and/or drm modules.
If I get those figured out (video is NOT my area) I'll be kinda stuck.

Hints/tips/suggestions welcome... Must say 2.6.11 looks better than 2.6.8.

Thanks,
-- 
Martin

        Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>

[1] http://www.mph.eclipse.co.uk/pub/linux/patches/2.6.11/genrtc.c.patch
[2] http://www.mph.eclipse.co.uk/pub/linux/patches/rtctest2.c
[3] http://www.mph.eclipse.co.uk/pub/linux/latency/test3/index.html



Reply to: