lkml.org 
[lkml]   [2011]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRTC seems broken on 2.6.38-rc1 for RTCs lacking alarms.
The hwclock program on my MIPS Debian GNU/Linux 5.0 system quit
working with 2.6.38-rc1.

This particular ds1307 has no interrupt connection, so the alarm
feature cannot be used. Because of this the
rtc_class_ops.set_alarm() function always will return -EINVAL


This problem appears to be related to commits:
042620a RTC: Remove UIE emulation
6610e08 RTC: Rework RTC code to use timerqueue for events

My system uses a ds1307 RTC which still works as evidenced by the
kernel boot messages.

.
.
.
rtc-ds1307 0-0068: setting system clock to 2011-01-20 19:58:48 UTC
(1295553528)
.
.
.

But hwclock now fails here is some nice strace output:
.
.
.
open("/dev/rtc0", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, PRESTO_GETMOUNT or RTC_UIE_ON, 0) = 0
_newselect(4, [3], NULL, NULL, {5, 0}) = 0 (Timeout)
write(2, "select() to /dev/rtc0 to wait for"..., 55select() to /dev/rtc0
to wait for clock tick timed out
) = 55
ioctl(3, PRESTO_SETPID or RTC_UIE_OFF, 0) = 0
close(3) = 0
exit_group(1) = ?


The hwclock program is asking to put the clock in UIE mode and then
does a select() on it. Since the alarm doesn't work, the select times out.

Previously the ioctl(RTC_UIE_ON) would return EINVAL:
.
.
.
open("/dev/rtc0", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, PRESTO_GETMOUNT or RTC_UIE_ON, 0) = -1 EINVAL (Invalid argument)
ioctl(3, PRESTO_SETOPT or RTC_RD_TIME, {tm_sec=48, tm_min=41,
tm_hour=20, tm_mday=20, tm_mon=0, tm_year=111, ...}) = 0
ioctl(3, PRESTO_SETOPT or RTC_RD_TIME, {tm_sec=48, tm_min=41,
tm_hour=20, tm_mday=20, tm_mon=0, tm_year=111, ...}) = 0
.
.
.

The problem seems to be that rtc_update_irq_enable() no longer returns
-EINVAL when it cannot set the alarm.

David Daney


\
 
 \ /
  Last update: 2011-01-20 21:53    [W:0.058 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site