All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiangfu Liu <xiangfu@openmobilefree.net>
To: john stultz <johnstul@us.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>,
	linux-mips@linux-mips.org,
	jz47xx-kernel@lists.en.qi-hardware.com,
	rtc-linux@googlegroups.com
Subject: Re: select() to /dev/rtc0 to wait for clock tick timed out
Date: Fri, 30 Dec 2011 16:31:53 +0800	[thread overview]
Message-ID: <4EFD76F9.50204@openmobilefree.net> (raw)
In-Reply-To: <1313783990.2970.136.camel@work-vm>

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

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 ***

[-- Attachment #2: hwclock.time.out --]
[-- Type: text/plain, Size: 3339 bytes --]

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)                           = ?

[-- Attachment #3: hwclock.works --]
[-- Type: text/plain, Size: 4591 bytes --]

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)                           = ?

  parent reply	other threads:[~2011-12-30  8:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19  4:16 select() to /dev/rtc0 to wait for clock tick timed out Matt Turner
2011-08-19 17:23 ` john stultz
2011-08-19 18:07 ` john stultz
2011-08-19 19:41   ` Matt Turner
2011-08-19 19:59     ` john stultz
2011-08-19 20:06       ` Matt Turner
2011-08-19 20:34         ` john stultz
2011-08-19 20:34           ` john stultz
2011-08-19 20:56           ` Matt Turner
2011-08-19 21:21             ` john stultz
2011-08-19 21:48               ` Matt Turner
2011-08-25 17:30                 ` Matt Turner
2011-08-26 16:05                   ` Atsushi Nemoto
2011-12-30  8:31       ` Xiangfu Liu [this message]
2012-03-16  8:53         ` Xiangfu Liu
2012-03-17  1:10         ` John Stultz
2012-03-18  7:03           ` Xiangfu Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EFD76F9.50204@openmobilefree.net \
    --to=xiangfu@openmobilefree.net \
    --cc=johnstul@us.ibm.com \
    --cc=jz47xx-kernel@lists.en.qi-hardware.com \
    --cc=linux-mips@linux-mips.org \
    --cc=mattst88@gmail.com \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.