[Top] [All Lists]

Re: select() to /dev/rtc0 to wait for clock tick timed out

To: John Stultz <>
Subject: Re: select() to /dev/rtc0 to wait for clock tick timed out
From: Xiangfu Liu <>
Date: Sun, 18 Mar 2012 15:03:08 +0800
Cc: Matt Turner <>,,,, Lars-Peter Clausen <>
In-reply-to: <>
References: <> <1313777242.2970.131.camel@work-vm> <> <1313783990.2970.136.camel@work-vm> <> <>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
Hi John

Thanks for reply. the patch is not working. I found a work around.
checkout this patch:

after apply this patch. the hwclock worksf ine again. but it is may not a good 

Please take a look give me some advice. Thanks John

On 03/17/2012 09:10 AM, John Stultz wrote:
On 12/30/2011 12:31 AM, Xiangfu Liu wrote:
I meet the same problem on MIPS jz4740, here is the step I try to find out the 

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, failed under '3.0.0'

Please give me some tips how to fix this problem. shoule I modify the driver 
or is that relate to 'CONFIG_RTC_INTF_DEV_UIE_EMUL'?

Sorry I missed this email originally, and thank you for pinging me.

Is CONFIG_RTC_INTF_DEV_UIE_EMUL set in the config you're seeing this with? Does 
disabling it change the behavior?

Just a shot in the dark, but does the following help at all?

Signed-off-by: John Stultz<>

diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c

index 05ab227..c6c81ba 100644

--- a/drivers/rtc/rtc-jz4740.c

+++ b/drivers/rtc/rtc-jz4740.c

@@ -171,7 +171,8 @@ static int jz4740_rtc_set_alarm(struct device *dev, struct 
rtc_wkalrm *alrm)

static int jz4740_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)


struct jz4740_rtc *rtc = dev_get_drvdata(dev);

- return jz4740_rtc_ctrl_set_bits(rtc, JZ_RTC_CTRL_AF_IRQ, enable);

+ return jz4740_rtc_ctrl_set_bits(rtc,



static struct rtc_class_ops jz4740_rtc_ops = {

<Prev in Thread] Current Thread [Next in Thread>