Hi John Stultz I meet the same problem on MIPS jz4740, here is the step I try to find out the problem: 1. when I direct run 'hwclock' it will give "select() to /dev/rtc0 to wait for clock tick timed out" attachment 'hwclock.time.out' is the strace log 2. run 'rtctest' program. it works fine. the output is here[1] 3. after 'rtctest', run 'hwclock' again. then it works fine attachment 'hwclock.wors' is the strace log without 'rtctest' run first. 'hwclock' never works. the hwclock works fine in 2.6.27.6, failed under '3.0.0' Please give me some tips how to fix this problem. shoule I modify the driver code or is that relate to 'CONFIG_RTC_INTF_DEV_UIE_EMUL'? thanks in advance. xiangfu [1] root@BenNanoNote:~# ./rtctest RTC Driver Test Example. Current RTC date/time is 30-12-2011, 08:25:55. Alarm time now set to 08:26:00. Waiting 5 seconds for alarm... okay. Alarm rang. Periodic IRQ rate is 64Hz. Counting 20 interrupts at: 2Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 8Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 16Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 32Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 64Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 *** Test complete ***
execve("/sbin/hwclock", ["hwclock"], [/* 15 vars */]) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aab7000 stat("/etc/ld.so.cache", 0x7faaa3f0) = -1 ENOENT (No such file or directory) open("/lib/libgcc_s.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=70228, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aab8000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\2204\0\0004\0\0\0"..., 4096) = 4096 old_mmap(NULL, 126976, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aac8000 old_mmap(0x2aac8000, 59116, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aac8000 old_mmap(0x2aae6000, 2476, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0x2aae6000 close(3) = 0 munmap(0x2aab8000, 4096) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=629904, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aab8000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0000\246\0\0004\0\0\0"..., 4096) = 4096 old_mmap(NULL, 675840, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aae7000 old_mmap(0x2aae7000, 577564, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aae7000 old_mmap(0x2ab84000, 7504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x8d000) = 0x2ab84000 old_mmap(0x2ab86000, 20604, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ab86000 close(3) = 0 munmap(0x2aab8000, 4096) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=629904, ...}) = 0 close(3) = 0 stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=31756, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aab8000 set_thread_area(0x2aabf2d0) = 0 mprotect(0x2ab84000, 4096, PROT_READ) = 0 mprotect(0x2aac6000, 4096, PROT_READ) = 0 ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TIOCNXCL, 0x7faaa3c0) = -1 ENOTTY (Inappropriate ioctl for device) gettimeofday({1325230583, 813665}, NULL) = 0 getuid() = 0 open("/dev/rtc", O_RDONLY|O_LARGEFILE) = 3 close(3) = 0 stat64(0x404840, 0x7faaa238) = 0 brk(0) = 0x701000 brk(0x702000) = 0x702000 open("/etc/adjtime", O_RDONLY|O_LARGEFILE) = 3 ioctl(3, TIOCNXCL, 0x7faaa1e8) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x703000) = 0x703000 read(3, "0.000000 1325230378 0.000000\n132"..., 4096) = 46 close(3) = 0 open("/dev/rtc", 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 ", 12select() to ) = 12 write(2, "/dev/rtc", 8/dev/rtc) = 8 write(2, " to wait for clock tick timed ou"..., 34 to wait for clock tick timed out ) = 34 ioctl(3, PRESTO_SETPID or RTC_UIE_OFF, 0) = 0 close(3) = 0 exit_group(1) = ?
execve("/sbin/hwclock", ["hwclock"], [/* 15 vars */]) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2ac15000 stat("/etc/ld.so.cache", 0x7fb21be0) = -1 ENOENT (No such file or directory) open("/lib/libgcc_s.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=70228, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2ac16000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\2204\0\0004\0\0\0"..., 4096) = 4096 old_mmap(NULL, 126976, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac26000 old_mmap(0x2ac26000, 59116, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ac26000 old_mmap(0x2ac44000, 2476, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0x2ac44000 close(3) = 0 munmap(0x2ac16000, 4096) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=629904, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2ac16000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0000\246\0\0004\0\0\0"..., 4096) = 4096 old_mmap(NULL, 675840, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac45000 old_mmap(0x2ac45000, 577564, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ac45000 old_mmap(0x2ace2000, 7504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x8d000) = 0x2ace2000 old_mmap(0x2ace4000, 20604, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ace4000 close(3) = 0 munmap(0x2ac16000, 4096) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=629904, ...}) = 0 close(3) = 0 stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=31756, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2ac16000 set_thread_area(0x2ac1d2d0) = 0 mprotect(0x2ace2000, 4096, PROT_READ) = 0 mprotect(0x2ac24000, 4096, PROT_READ) = 0 ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TIOCNXCL, 0x7fb21bb0) = -1 ENOTTY (Inappropriate ioctl for device) gettimeofday({1325231181, 400545}, NULL) = 0 getuid() = 0 open("/dev/rtc", O_RDONLY|O_LARGEFILE) = 3 close(3) = 0 stat64(0x404840, 0x7fb21a28) = 0 brk(0) = 0xa6c000 brk(0xa6d000) = 0xa6d000 open("/etc/adjtime", O_RDONLY|O_LARGEFILE) = 3 ioctl(3, TIOCNXCL, 0x7fb219d8) = -1 ENOTTY (Inappropriate ioctl for device) brk(0xa6e000) = 0xa6e000 read(3, "0.000000 1325230378 0.000000\n132"..., 4096) = 46 close(3) = 0 open("/dev/rtc", O_RDONLY|O_LARGEFILE) = 3 ioctl(3, PRESTO_GETMOUNT or RTC_UIE_ON, 0) = 0 _newselect(4, [3], NULL, NULL, {5, 0}) = 1 (in [3], left {3, 20190}) ioctl(3, PRESTO_SETPID or RTC_UIE_OFF, 0) = 0 close(3) = 0 gettimeofday({1325231183, 397422}, NULL) = 0 open("/dev/rtc", O_RDONLY|O_LARGEFILE) = 3 ioctl(3, PRESTO_SETOPT or RTC_RD_TIME, {tm_sec=23, tm_min=46, tm_hour=7, tm_mday=30, tm_mon=11, tm_year=111, ...}) = 0 close(3) = 0 time(NULL) = 1325231183 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 time(NULL) = 1325231183 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 time(NULL) = 1325231183 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 open("/etc/TZ", O_RDONLY) = 3 read(3, "UTC\n", 68) = 4 close(3) = 0 write(1, "Fri Dec 30 07:46:23 2011 -1.996"..., 44Fri Dec 30 07:46:23 2011 -1.996877 seconds ) = 44 exit_group(0) = ?