Re: Question about the RTC device

Paul Gortmaker (gpg109@rsphy1.anu.edu.au)
Thu, 18 Apr 1996 14:28:39 +1000 (EST)


Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Tue, 16 Apr 1996 16:39:54 +0100

> I have a few questions about the new RTC device in 1.3.89:
>
> First, what is the advantage of using RTC interrupts and read as
> opposed to using itimers (frequencies below 100 Hz assumed)?

You can use frequencies above 100Hz. :-) Also you don't have to wait
for the next timer interrupt + delivery of SIGALM. The interrupt
rec'vd will immediately add_to_runqueue the process associated with the
blocked read. And think about what quality you will get if you try to
generate a 64Hz signal with something that has a max granularity of 100Hz.
The following shows times in ms for a 64Hz signal (top) and the times at
which a 100Hz signal would fire (bottom), given that timers never expire
before the requested time.

0 15.6 31.3 46.9 62.5 78.1 93.8 109 125 141 156 172
| | | | | | | | | | | |
==========================================================================
| | | | | | | | | | |
0 20 40 50 70 80 100 110 130 150 160
(+0) (+4) (+9) (+3) (+7) (+2) (+6) (+1) (+5) (+9) (+4)

The sequence starts over again at 250ms. Not verry pretty is it?
I wouldn't be too impressed. Depends on your requirements, I guess.

> Secondly, the RTC ports are no longer requested in the setup code, but
> has been moved into the RTC driver. Is the kernel still updating the
> RTC clock, even if the RTC device is not configured?

Same as before. Didn't touch arch/XXX/kernel/time.c -- you can relax.

> Finally wouldn't it be wise to check the result of the request_region
> (maybe just to find some resource conflict)?

Don't be pedantic. Would you have us do a check region for the two
interrupt controllers, the two DMA controllers, the keyboard, and
everything else below 0x100 ??? How about this? B-)

if (check_region(0x80, 1))
panic("Dummy/delay port (inb_p/outb_p) in use. Giving up.\n");

> Besides the questions I have one wish. Wouldn't it be nice to use
> some internationally agreeable format for date and time that is
> still easy to read and parse (for /proc/RTC)? I'm strongly thinking
> about the format RCS uses (1996/04/15 12:43:44).

I suppose. I don't expect people to parse /dev/rtc when you can get
it in a proper struct tm via ioctl(fd, RTC_RD_TIME, &tm);

Paul.