Dear colleague,
I am trying to use the linux RTC driver for a home automatization
project. The idea is to rely on the RTC Alarm to automatically
power-on the computer at the time specified in the RTC Alarm
register.
To this end, it is necessary to keep the 'enable alarm interrupts'
flag (RTC_AIE) ON, not only after the process handling the rtc
ends, but also (and more importantly) after Linux has halted and
the computer has been powered off.
I have found that the current rtc driver implementation
automatically disables RTC_AIE upon rtc close:
tmp = CMOS_READ(RTC_CONTROL);
tmp &= ~RTC_PIE;
tmp &= ~RTC_AIE;
tmp &= ~RTC_UIE;
CMOS_WRITE(tmp, RTC_CONTROL);
By simply commenting out the line 'tmp &= ~RTC_AIE;' this
problem is easily fixed and one can set the Alarm in one
process and let a different process wait for the Alarm 'RING'.
However, this trivial patch does not seem to prevent RTC_AIE
to be disabled during Linux shutdown. ... Or may be during
Linux boot, since I have no means to check the status of this
flag in the RTC CMOS until Linux has again come to life after
shutdown.
I have been looking at the 'rtc_init' procedure of rtc.c but,
apparently, it does not seem to touch this bit. So I am writing
to see if you can provide some help in this matter!
I think this issue is of general relevance since, unless what
happens with other RTC IRQ requests (e.g. RTC_PIE), the Alarm
is **ONLY** useful for the application of bringing to life a dead
computer at a specific time. Other time-events which can be
waited for with a live computer are much more easily and
conveniently managed using at and cron...
Best,
Enrique.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/