2003-11-08 21:39:53

by Bob McElrath

[permalink] [raw]
Subject: /dev/rtc on alpha

In a nutshell, the rtc driver on alpha does not work. This is easily
verified with the small program in Documentation/rtc.txt -- all ioctl's
fail. (I tried on an LX164 and a CS20) That's the /dev/rtc driver
drivers/char/rtc.c. I'd like to make it work but don't understand
what's going on with the rtc interrupt in arch/alpha/kernel/*. So, can
some expert comment on this situation for me?

The /dev/rtc driver builds and loads fine but the define RTC_IRQ is not
set in include/asm-alpha/mc146818rtc.h. Naievely setting it, the driver
still builds and loads, but is unable to grab the interrupt (IRQ 8)
because the code in arch/alpha/kernel grabbed it first.

Why is the alpha kernel code grabbing the rtc interrupt? Is it possible
it share its use with a user program? Would reprogramming the interrupt
rate by a user program do violence to some internel kernel timing?

Thanks,
Bob McElrath [Univ. of California at Davis, Department of Physics]


Attachments:
(No filename) (955.00 B)
signature.asc (189.00 B)
Digital signature
Download all attachments

2003-11-09 11:24:58

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: /dev/rtc on alpha

On Sat, Nov 08, 2003 at 01:33:57PM -0800, Bob McElrath wrote:
> Why is the alpha kernel code grabbing the rtc interrupt? Is it possible
> it share its use with a user program? Would reprogramming the interrupt
> rate by a user program do violence to some internel kernel timing?

On most Alphas RTC is the system timer (running at 1024 Hz).
So changing the interrupt rate from user space wouldn't be a good idea.

Ivan.

2003-11-09 17:50:53

by Bob McElrath

[permalink] [raw]
Subject: Re: /dev/rtc on alpha

Ivan Kokshaysky [[email protected]] wrote:
> On Sat, Nov 08, 2003 at 01:33:57PM -0800, Bob McElrath wrote:
> > Why is the alpha kernel code grabbing the rtc interrupt? Is it possible
> > it share its use with a user program? Would reprogramming the interrupt
> > rate by a user program do violence to some internel kernel timing?
>
> On most Alphas RTC is the system timer (running at 1024 Hz).
> So changing the interrupt rate from user space wouldn't be a good idea.

Then I propose CONFIG_RTC be set to "n" in the arch/alpha files, and the
/dev/rtc driver be disabled on alpha. There seems to be confusion on
this point in the config files. CONFIG_RTC is for the /dev/rtc driver.

Since the timer can only be set to powers of 2, it should be possible to
simulate getting the interrupt by calling the rtc.c interrupt handler
every 2^n interrupts...that way the user could program the timer for any
interval less than 1024 Hz.

Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]


Attachments:
(No filename) (0.99 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2003-11-09 19:05:54

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: /dev/rtc on alpha

On Sun, 9 Nov 2003, Bob McElrath wrote:
> Ivan Kokshaysky [[email protected]] wrote:
> > On Sat, Nov 08, 2003 at 01:33:57PM -0800, Bob McElrath wrote:
> > > Why is the alpha kernel code grabbing the rtc interrupt? Is it possible
> > > it share its use with a user program? Would reprogramming the interrupt
> > > rate by a user program do violence to some internel kernel timing?
> >
> > On most Alphas RTC is the system timer (running at 1024 Hz).
> > So changing the interrupt rate from user space wouldn't be a good idea.
>
> Then I propose CONFIG_RTC be set to "n" in the arch/alpha files, and the
> /dev/rtc driver be disabled on alpha. There seems to be confusion on
> this point in the config files. CONFIG_RTC is for the /dev/rtc driver.

As an alternative, you can try using genrtc instead.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds