# [SOLVED] Problem with hwclock

## zietbukuel

Hello, I have this problem ever since I installed my system. I'm using stable with debian-sources-3.2.41 and I used genkernel to automatically configure the kernel and build it for me.

This is the outout of dmesg|grep rtc:

```
[    5.373278] rtc_cmos 00:05: RTC can wake from S4

[    5.373349] rtc_cmos 00:05: rtc core: registered rtc_cmos as rtc0

[    5.373368] rtc0: alarms up to one month, y3k, 114 bytes nvram, hpet irqs

[    5.374885] rtc_cmos 00:05: setting system clock to 2013-06-26 10:32:32 UTC (1372242752)
```

This is the output of grep RTC /usr/src/linux/.config:

```
CONFIG_HPET_EMULATE_RTC=y

# CONFIG_PM_TRACE_RTC is not set

CONFIG_RTC_LIB=y

CONFIG_RTC_CLASS=y

CONFIG_RTC_HCTOSYS=y

CONFIG_RTC_HCTOSYS_DEVICE="rtc0"

# CONFIG_RTC_DEBUG is not set

# RTC interfaces

CONFIG_RTC_INTF_SYSFS=y

CONFIG_RTC_INTF_PROC=y

CONFIG_RTC_INTF_DEV=y

# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set

# CONFIG_RTC_DRV_TEST is not set

# I2C RTC drivers

CONFIG_RTC_DRV_DS1307=m

CONFIG_RTC_DRV_DS1374=m

CONFIG_RTC_DRV_DS1672=m

# CONFIG_RTC_DRV_DS3232 is not set

CONFIG_RTC_DRV_MAX6900=m

CONFIG_RTC_DRV_RS5C372=m

CONFIG_RTC_DRV_ISL1208=m

# CONFIG_RTC_DRV_ISL12022 is not set

CONFIG_RTC_DRV_X1205=m

CONFIG_RTC_DRV_PCF8563=m

CONFIG_RTC_DRV_PCF8583=m

CONFIG_RTC_DRV_M41T80=m

# CONFIG_RTC_DRV_M41T80_WDT is not set

CONFIG_RTC_DRV_BQ32K=m

CONFIG_RTC_DRV_S35390A=m

CONFIG_RTC_DRV_FM3130=m

CONFIG_RTC_DRV_RX8581=m

CONFIG_RTC_DRV_RX8025=m

# CONFIG_RTC_DRV_EM3027 is not set

# CONFIG_RTC_DRV_RV3029C2 is not set

# SPI RTC drivers

# CONFIG_RTC_DRV_M41T93 is not set

CONFIG_RTC_DRV_M41T94=m

CONFIG_RTC_DRV_DS1305=m

CONFIG_RTC_DRV_DS1390=m

CONFIG_RTC_DRV_MAX6902=m

CONFIG_RTC_DRV_R9701=m

CONFIG_RTC_DRV_RS5C348=m

CONFIG_RTC_DRV_DS3234=m

CONFIG_RTC_DRV_PCF2123=m

# Platform RTC drivers

CONFIG_RTC_DRV_CMOS=y

CONFIG_RTC_DRV_DS1286=m

CONFIG_RTC_DRV_DS1511=m

CONFIG_RTC_DRV_DS1553=m

CONFIG_RTC_DRV_DS1742=m

CONFIG_RTC_DRV_STK17TA8=m

CONFIG_RTC_DRV_M48T86=m

CONFIG_RTC_DRV_M48T35=m

CONFIG_RTC_DRV_M48T59=m

CONFIG_RTC_DRV_MSM6242=m

CONFIG_RTC_DRV_BQ4802=m

CONFIG_RTC_DRV_RP5C01=m

CONFIG_RTC_DRV_V3020=m

CONFIG_RTC_DRV_PCF50633=m

# on-CPU RTC drivers

```

And this is the output of hwclock --debug:

```
hwclock from util-linux 2.21.2

hwclock: Open of /dev/rtc failed: Device or resource busy

No usable clock interface found.

hwclock: Cannot access the Hardware Clock via any known method.
```

Finally, this is the output of ls -l /dev/rtc*:

```
lrwxrwxrwx 1 root root      4 Jun 26 05:32 /dev/rtc -> rtc0

crw------- 1 root root 254, 0 Jun 26 05:32 /dev/rtc0
```

So, as you see I do have the RTC feature in my kernel and the device file exists, but I just can't figure out what's going on here and why is this failing, any help is appreciated.

Thanks!Last edited by zietbukuel on Fri Jun 28, 2013 8:22 am; edited 2 times in total

----------

## eyoung100

```
rtc0: alarms up to one month, y3k, 114 bytes nvram, hpet irqs 

rtc_cmos 00:05: setting system clock to 2013-06-26 10:32:32 UTC (1372242752)

rtc0 and rtc_cmos are not equal to /dev/rtc and iirc symlink lookup is failing
```

----------

## zietbukuel

 *eyoung100 wrote:*   

> 
> 
> ```
> rtc0: alarms up to one month, y3k, 114 bytes nvram, hpet irqs 
> 
> ...

 

Could you please elaborate a bit more your answer? I can't seem to understand what you mean. Thanks.

----------

## eyoung100

/dev/rtc is a real device node.  you can't overwrite it with a symlink

----------

## zietbukuel

 *eyoung100 wrote:*   

> /dev/rtc is a real device node.  you can't overwrite it with a symlink

 

I didn't do anything with it. How can I fix this? Thanks.

----------

## Ant P.

If you have working NTP then it may be better to not use hwclock at all. 3.9 kernels have the ability to sync system time to the hardware on their own so that program is entirely unneeded.

----------

## mike155

/dev/rtc is a link to /dev/rtc0 on all of my systems - this doesn't seem to be a problem. 

I don't see anything wrong in your first message - output of 'dmesg' and your kernel config parameters seem to be fine. 

Possible reasons:

1) Some other program disturbs /dev/rtc. Please reboot your system in single user mode. Does 'hwclock' still report an error?

2) Your kernel version is too old. Try a newer kernel: 3.9 from http://www.kernel.org

If this doesn't help, use Google and search for 'Linux rtc busy hwclock'. Many people have similar problems...

----------

## zietbukuel

 *bug_report wrote:*   

> /dev/rtc is a link to /dev/rtc0 on all of my systems - this doesn't seem to be a problem. 
> 
> I don't see anything wrong in your first message - output of 'dmesg' and your kernel config parameters seem to be fine. 
> 
> Possible reasons:
> ...

 

Maybe, this kernel is 3.2 (debian-sources). I'll try to update to 3.9 (gentoo-sources).

----------

## zietbukuel

Well, I have updated to 3.9 gentoo-sources and I'm still having this annoying problem, my clock is going faster than it should and messes up things, any help, please? Thanks.

----------

## zietbukuel

Ok I found the answer.

Deactivate: 

Device Drivers -> Real Time Clock 

Activate: 

Device Drivers -> Character Devices -> HPET High Precision Event Timer 

Device Drivers -> Character Devices -> Enhanced Real Time Clock Support 

Hope this helps someone having the same problem.

----------

## hujuice

I ran in the same problem.

And I cannot activate CONFIG_RTC because it is deselected by CONFIG_RTC_LIB, which in turn is selected by CONFIG_X86...

 *Ant P. wrote:*   

> If you have working NTP then it may be better to not use hwclock at all. 3.9 kernels have the ability to sync system time to the hardware on their own so that program is entirely unneeded.

 

@Ant P., you mean that CONFIG_RTC_LIB will perform the task? (or something similar...)

My ntpd is working fine.

Regards,

HUjuice

----------

## Ant P.

 *hujuice wrote:*   

> I ran in the same problem.
> 
> And I cannot activate CONFIG_RTC because it is deselected by CONFIG_RTC_LIB, which in turn is selected by CONFIG_X86...
> 
>  *Ant P. wrote:*   If you have working NTP then it may be better to not use hwclock at all. 3.9 kernels have the ability to sync system time to the hardware on their own so that program is entirely unneeded. 
> ...

 

The option is CONFIG_RTC_SYSTOHC, under the CONFIG_RTC_CLASS menu.

----------

## hujuice

Uh, nice.

Thanks Ant P.   :Smile: 

----------

