linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RTC seems broken on 2.6.38-rc1 for RTCs lacking alarms.
@ 2011-01-20 20:51 David Daney
  2011-01-20 21:16 ` John Stultz
  0 siblings, 1 reply; 6+ messages in thread
From: David Daney @ 2011-01-20 20:51 UTC (permalink / raw)
  To: John Stultz, Linux Kernel Mailing List, Linus Torvalds,
	Alessandro Zummo, Thomas Gleixner

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-21 10:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 20:51 RTC seems broken on 2.6.38-rc1 for RTCs lacking alarms David Daney
2011-01-20 21:16 ` John Stultz
2011-01-20 21:24   ` Geert Uytterhoeven
2011-01-20 22:23     ` John Stultz
2011-01-20 22:54       ` David Daney
2011-01-21 10:48         ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).