It is currently 08 Sep 2010, 12:36

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Unable to configure Hardware clock [solved]
PostPosted: 23 Sep 2009, 06:53 
Offline

Joined: 23 Sep 2009, 05:59
Posts: 15
Hi everybody

I have just installed cruxppc on an Apple G5, which was straight forward and generally uneventful. However, when i booted into the new system I received this complaint:

Quote:
Timed out waiting for time change.
hwclock: settimeofday() failed, errno=22: Invalid argument.
Unable to set system clock.


so I poked around a bit:

Quote:
#date 092308302009
#date
Wed Sept 23 08:30:05 CEST 2009
#hwclock --systohc
Timed out waiting for time change.
RTC_SET_TIME: No such device
ioctl() to /devrtc0 to set the time failed.
#hwclock --test
Timed out waiting for time change.
Sun Dec 31 00:00:00 1899 -1.501994 seconds


However, when I chroot to this system from OpenSUSE
I get these messages:

Code:
gustav@dhcppc0:~> sudo mount -t reiserfs /dev/sdb6 /mnt/crux/
root's password:
gustav@dhcppc0:~> sudo mount -t reiserfs /dev/sdb9 /mnt/crux/var
gustav@dhcppc0:~> sudo mount -t xfs /dev/sdb10 /mnt/crux/home
gustav@dhcppc0:~> sudo mount --bind /dev /mnt/crux/dev
gustav@dhcppc0:~> sudo mount --bind /tmp /mnt/crux/tmp
gustav@dhcppc0:~> sudo mount -t proc proc /mnt/crux/proc
gustav@dhcppc0:~> sudo mount -t sysfs none /mnt/crux/sys
gustav@dhcppc0:~> sudo chroot /mnt/crux/ /bin/bash
bash-4.0# date
Wed Sep 23 09:17:55 CEST 2009
bash-4.0# hwclock
Wed Sep 23 07:18:08 2009  -0.936818 seconds
bash-4.0# date
Wed Sep 23 09:30:08 CEST 2009
bash-4.0# hwclock --debug
hwclock from util-linux-ng 2.15
Using /dev interface to clock.
Last drift adjustment done at 0 seconds after 1969
Last calibration done at 0 seconds after 1969
Hardware clock is on unknown time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
/dev/rtc does not have interrupt functions. Waiting in loop for time from /dev/rtc to change
...got clock tick
Time read from Hardware Clock: 2009/09/23 07:32:15
Hw clock time : 2009/09/23 07:32:15 = 1253683935 seconds since 1969
Wed Sep 23 07:32:15 2009  -0.955916 seconds
bash-4.0#


But it's the "/dev/rtc does not have interrupt functions." that I am wondering about. Is the hardware clock also being read from the OpenSUSE system at this point?

this is what uname returns while in the chroot shell:

Quote:
Linux dhcppc0 2.6.27.7-9-ppc64 #1 SMP 2008-12-04 18:10:04 +0100 ppc64 PPC970, altivec supported PowerMac7,2 GNU/Linux

Which is of course describes the hostname and the kernel from OpenSUSE.

I look forward to a helping hand.

Gustav4


Last edited by Gustav4 on 02 Oct 2009, 11:06, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 23 Sep 2009, 10:59 
Offline
User avatar

Joined: 17 Dec 2005, 14:31
Posts: 244
Location: Italy
do you have enabled RTC interfaces section in your own recompiled kernel?
As you can see chrooting into CRUX PPC from OpenSUSE, your clock works fine 'cause his own interface is enabled in that kernel.


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 23 Sep 2009, 19:43 
Offline

Joined: 23 Sep 2009, 05:59
Posts: 15
Good point!

I'm sure I compiled the kernel with RTC support, but I'll double check it to see if there was an over sight here.

Thanks.


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 23 Sep 2009, 20:20 
Offline

Joined: 23 Sep 2009, 05:59
Posts: 15
Here is some code from the RTC attributes for the kernel I had built:

Code:
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
CONFIG_ACCESSIBILITY=y                     
CONFIG_INFINIBAND=m                       
# CONFIG_INFINIBAND_USER_MAD is not set   
# CONFIG_INFINIBAND_USER_ACCESS is not set
CONFIG_INFINIBAND_ADDR_TRANS=y             
# CONFIG_INFINIBAND_MTHCA is not set       
# CONFIG_INFINIBAND_IPATH is not set       
# CONFIG_INFINIBAND_AMSO1100 is not set   
# CONFIG_MLX4_INFINIBAND is not set       
# CONFIG_INFINIBAND_NES is not set         
# CONFIG_INFINIBAND_IPOIB is not set       
# CONFIG_INFINIBAND_SRP is not set         
# CONFIG_INFINIBAND_ISER is not set       
# CONFIG_EDAC is not set                   
CONFIG_RTC_LIB=y                           
CONFIG_RTC_CLASS=y                         
CONFIG_RTC_HCTOSYS=y                       
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"           
CONFIG_RTC_DEBUG=y                         

#
# 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 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set

#
# SPI RTC drivers
#

#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_V3020 is not set

#
# on-CPU RTC drivers
#
CONFIG_RTC_DRV_PPC=y
CONFIG_DMADEVICES=y

#
# DMA Devices
#
# CONFIG_UIO is not set
# CONFIG_STAGING is not set




Perhaps your keen eye can catch a problem with this configuration?

Ciao for now,

Gustav4


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 23 Sep 2009, 20:47 
Offline
User avatar

Joined: 17 Dec 2005, 14:31
Posts: 244
Location: Italy
mmh, maybe because you explicitly declared rtc0 as device. That's an udev work.

give a try recompiling with:
Code:
acrux@power4:~$ uname -a
Linux power4 2.6.30.3 #1 SMP Sun Jul 26 16:48:39 UTC 2009 ppc64 POWER4+ (gq) CHRP IBM,9114-275 GNU/Linux
acrux@power4:~$ cat /proc/config.gz|gunzip | grep RTC
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
# 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 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# SPI RTC drivers
# Platform RTC drivers
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_V3020 is not set
# on-CPU RTC drivers
CONFIG_RTC_DRV_GENERIC=y

Code:
root@power4:~# hwclock --debug
hwclock from util-linux-ng 2.15.1
Using /dev interface to clock.
Last drift adjustment done at 1251964056 seconds after 1969
Last calibration done at 1251964056 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
/dev/rtc0 does not have interrupt functions. Waiting in loop for time from /dev/rtc0 to change
...got clock tick
Time read from Hardware Clock: 2009/09/23 21:43:13
Hw clock time : 2009/09/23 21:43:13 = 1253742193 seconds since 1969
Wed Sep 23 21:43:13 2009  -0.101697 seconds


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 25 Sep 2009, 14:07 
Offline

Joined: 23 Sep 2009, 05:59
Posts: 15
hi acrux

I followed your advice recompiled but unfortunately the clockworks are still botched:

Code:
bash-4.0# cat .config| grep RTC
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_RTC_DEBUG=y
# 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 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# SPI RTC drivers
# Platform RTC drivers
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_V3020 is not set
# on-CPU RTC drivers
CONFIG_RTC_DRV_PPC=y
bash-4.0#


Then I recompiled and rebooted, and yet there was the same message that the hardware clock can not be set, (by any known methods, etc).

Code:
hwclock from util-linux-ng 2.15
Using /dev interface to clock.
Last drift adjustment done at 0 seconds after 1969
Last calibration done at 0 seconds after 1969
Hardware clock is on unknown time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
/dev/rtc0 does not have interrupt functions. Waiting in loop for time from /dev/rtc0 to change
...synchronization failed
Time read from Hardware Clock: 1900/01/00 00:00:00
Hw clock time : 1899/12/31 00:00:00 = -2209078800 seconds since 1969
Sun Dec 31 00:00:00 1899  -1.501913 seconds


and this output from hwclock --systohc

Code:
Timed out waiting for time change.
RTC_SET_TIME: No such device
ioctl() to /dev/rtc0 to set the time failed.


I'm stumped.


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 25 Sep 2009, 14:28 
Offline
User avatar

Joined: 17 Dec 2005, 14:31
Posts: 244
Location: Italy
i can read
Code:
# on-CPU RTC drivers
CONFIG_RTC_DRV_PPC=y


please use a more recent kernel, 2.6.30.x or 2.6.31.x


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 28 Sep 2009, 11:11 
Offline

Joined: 23 Sep 2009, 05:59
Posts: 15
Hi acrux

I recompiled using the latest kernel (2.6.31.1) and the problem was still persistent. However, I found out the source of the hardware clock problems:
Code:
  [*] Macintosh device drivers  --->
[ ]   Support for PMU  based PowerMacs
[*]   Support for SMU  based PowerMacs
[*]   Support for mouse button 2+3 emulation
<*>   Support for thermal management on PowerMac G5               
< >   New PowerMac thermal control infrastructure
< >   Support for Apple XServe front panel LEDs 


I was building a Kernel based on SMU, instead of PMU.
Now? The clock works, and can be configured.

But in all of this compiling frenzy, I was also trying to put out a couple of fires that popped up while compiling the new kernel. I was constantly bashing my head against the wall with these output messages from the make program:

Code:
$ make -j4 CONFIG_DEBUG_SECTION_MISMATCH=y | tee > kbuild/G5config3.build
dnsdomainname: Host name lookup failure
WARNING: vmlinux.o(.text+0x72d0): Section mismatch in reference from the function .start_secondary_prolog() to the function .devinit.text:.start_secondary()
The function .start_secondary_prolog() references
the function __devinit .start_secondary().
This is often because .start_secondary_prolog lacks a __devinit
annotation or the annotation of .start_secondary is wrong.

WARNING: vmlinux.o(.text+0x16f0c): Section mismatch in reference from the function .early_setup_secondary() to the function .cpuinit.text:.early_init_mmu_secondary()
The function .early_setup_secondary() references
the function __cpuinit .early_init_mmu_secondary().
This is often because .early_setup_secondary lacks a __cpuinit
annotation or the annotation of .early_init_mmu_secondary is wrong.



Plus these ones based on a g5_defconfig, mind you I adjusted it for my PMU G5 and Radeon graphics Card.

Code:
$ make -j4 CONFIG_DEBUG_SECTION_MISMATCH=y | tee > kbuild/G5config4.build
dnsdomainname: Host name lookup failure
sound/ppc/awacs.c: In function 'snd_pmac_awacs_init':
sound/ppc/awacs.c:886: warning: 'master_vol' may be used uninitialized in this function
drivers/gpu/drm/drm_edid.c: In function 'drm_detect_hdmi_monitor':
drivers/gpu/drm/drm_edid.c:704: warning: array subscript is above array bounds
drivers/pci/probe.c: In function '__pci_read_base':
drivers/pci/probe.c:196: warning: large integer implicitly truncated to unsigned type
WARNING: vmlinux.o(.text+0x72d0): Section mismatch in reference from the function .start_secondary_prolog() to the function .devinit.text:.start_secondary()
The function .start_secondary_prolog() references
the function __devinit .start_secondary().
This is often because .start_secondary_prolog lacks a __devinit
annotation or the annotation of .start_secondary is wrong.

WARNING: vmlinux.o(.text+0x15bc8): Section mismatch in reference from the function .early_setup_secondary() to the function .cpuinit.text:.early_init_mmu_secondary()
The function .early_setup_secondary() references
the function __cpuinit .early_init_mmu_secondary().
This is often because .early_setup_secondary lacks a __cpuinit
annotation or the annotation of .early_init_mmu_secondary is wrong.


Before I start a new thread regarding this, I'd just like to know if you have encountered these kernel building problems before?

Thanks for you help and consideration regarding the clock problem.
Gustav4


Top
 Profile  
 
 Post subject: Re: Unable to configure Hardware clock after installation
PostPosted: 01 Oct 2009, 21:35 
Offline
User avatar

Joined: 17 Dec 2005, 14:31
Posts: 244
Location: Italy
Gustav4 wrote:
I was building a Kernel based on SMU, instead of PMU.
Now? The clock works, and can be configured.


you're right, thanks for pointing that! I'll add this experience into our FAQ.

Quote:
Before I start a new thread regarding this, I'd just like to know if you have encountered these kernel building problems before?


please submit a new topic.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: