hwclock "hanging" for ~24 hours

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have an ARM board with isl1208 hardware clock.

When power (battery) fails, the system boots with the following kernel info:

# dmesg | grep rtc
rtc-isl1208 0-006f: chip found, driver version 0.3
rtc-isl1208 0-006f: rtc core: registered rtc-isl1208 as rtc0
rtc-isl1208 0-006f: rtc power failure detected, please set clock.


Unfortunately, "hwclock" command hangs in that case (hwclock from old util-linux, stable util-linux-ng and git tree of util-linux-ng), so booting is impossible (booting "hangs" somewhere in startup scripts when "hwclock" is executed).
It hangs so for about 24 hours (I didn't check precisely, so it may be also 10 hours, which shouldn't matter that much).

When straced, it looks like below:

# strace ./hwclock --show
execve("./hwclock", ["./hwclock", "--show"], [/* 20 vars */]) = 0
uname({sys="Linux", node="SERVER-K", ...}) = 0
brk(0)                                  = 0x17000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=17187, ...}) = 0
mmap2(NULL, 17187, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40016000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1a\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0HO\1\0004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1091040, ...}) = 0
mmap2(NULL, 1128068, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4001e000
mprotect(0x40125000, 50820, PROT_NONE)  = 0
mmap2(0x4012c000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x106) = 0x4012c000
mmap2(0x4012f000, 9860, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4012f000
close(3)                                = 0
mprotect(0x4012c000, 8192, PROT_READ)   = 0
mprotect(0x4001c000, 4096, PROT_READ)   = 0
munmap(0x40016000, 17187)               = 0
gettimeofday({184, 14828}, NULL)        = 0
brk(0)                                  = 0x17000
brk(0x38000)                            = 0x38000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1209120, ...}) = 0
mmap2(NULL, 1209120, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40132000
close(3)                                = 0
getuid32()                              = 0
open("/dev/rtc", O_RDONLY|O_LARGEFILE)  = 3
close(3)                                = 0
stat64("/etc/adjtime", {st_mode=S_IFREG|0644, st_size=44, ...}) = 0
open("/etc/adjtime", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
read(3, "0.940732 1193442713 0.000000\n119"..., 4096) = 44
close(3)                                = 0
munmap(0x40016000, 4096)                = 0
open("/dev/rtc", O_RDONLY|O_LARGEFILE)  = 3
ioctl(3, RTC_UIE_ON, 0)                 = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
ioctl(3, RTC_RD_TIME, {tm_sec=0, tm_min=0, tm_hour=0, tm_mday=0, tm_mon=-1, tm_year=100, ...}) = 0
(...)

And it just loops here all the time.


hwclock from busybox does not have this issue and is able to read and set this clock properly (afterwards, hwclock from util-linux-ng works as well):

# ./busybox hwclock --help
(...)
Options:
      -r      Show hardware clock time
      -s      Set system time from hardware clock
      -w      Set hardware clock to system time
      -u      Hardware clock is in UTC
      -l      Hardware clock is in local time
      -f FILE Use specified device (e.g. /dev/rtc2)


# ./busybox hwclock -r
Tue Nov 30 00:00:00 1999  0.000000 seconds
# date
Fri Aug  8 21:50:59 CEST 2008
# ./busybox hwclock -w
Fri Aug  8 21:51:24 2008  0.000000 seconds
# hwclock.disabled --show
Fri 08 Aug 2008 11:51:33 PM CEST -0.793693 seconds

See also this message on rtc-linux group:

http://groups.google.com/group/rtc-linux/browse_thread/thread/85ed7545e87bee47/e21fd0d7562fda38?lnk=gst&q=+it's+a+known+bug+of+hwclock#e21fd0d7562fda38


--
Tomasz Chmielewski
http://wpkg.org
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux