2007-11-09 16:47:49

by David Madore

[permalink] [raw]
Subject: any help on RTC-related config? (and "rtc_cmos: probe of 00:03 failed with error -16" error message)

Hi all,

I'm extremely confused as to what all the RTC-related config variables
in the kernel mean and what I'm supposed to do with them, and I wonder
if someone can help me or point me to some doc beside rtc.txt (which
I've read, of course).

I understand (from reading Documentation/rtc.txt) that there are two
different RTC driver systems for Linux: an "old" one, supporting only
one PC-AT-compatible RTC source, which drives /dev/rtc, and a "new"
one, supporting different sources, which drives /dev/rtc[0123...].
But I'm not sure which configuration variables enable which, whether
they should be enabled together or whether I should choose between the
twain, and what I should be using on my system anyway.

I sort of gathered (I hope not too incorrectly) that the "genrtc"
module is brought by the CONFIG_GEN_RTC configuration choice and that
it contains the "old" driver, whereas the "new" driver is split
between modules such as "rtc", "rtc_lib", "rtc_core" and actual
drivers like "rtc_cmos" - right? - and configured by such switches as
CONFIG_RTC_CLASS, CONFIG_RTC_LIB and CONFIG_RTC_DRV_CMOS. There might
also be a CONFIG_RTC variable, about which I'm not sure.

I'm also very confused about how HPET's tie into this, and what
CONFIG_HPET_EMULATE_RTC does, for example.

Now how do I know what's on my system? (It's an ASUS P5W64 WS Pro
based x86_64.) I certainly have some kind of CMOS clock that I can
configure in my BIOS, but I don't know about HPET's or other kind of
RTC sources.

I tried using the following config (this is all with 2.6.22.10):

CONFIG_RTC=m
CONFIG_GEN_RTC=m
CONFIG_GEN_RTC_X=y
CONFIG_HPET=y
# CONFIG_HPET_RTC_IRQ is not set
CONFIG_RTC_LIB=m
CONFIG_RTC_CLASS=m
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_TEST=m
CONFIG_RTC_DRV_CMOS=m
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_V3020 is not set

Now if I load the genrtc module (to use the "old" driver?), I get a
/dev/rtc which may or may not be satisfactory but the
dev.rtc.max-user-freq sysctl does not exist and ALSA does not use
snd_rtctimer. If I try unloading genrtc and instead loading the rtc,
rtc_lib, rtc_core and rtc_cmos modules (to use the "new" driver?), I
get the following error in dmesg:

Real Time Clock Driver v1.12ac
rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
rtc_cmos: probe of 00:03 failed with error -16

After what attempts to, e.g., play a MIDI file with ALSA, fail (only a
single note is played) and the following error occurs in dmesg:

rtc: lost some interrupts at 1024Hz.

So, why does rtc_cmos fail that way? And how am I supposed to
configure RTC as a whole? (I will, of course, gladly provide more
information if requested.)

Thanks for any help!

--
David A. Madore
([email protected],
http://www.madore.org/~david/ )