Activity log for bug #1252242

Date Who What changed Old value New value Message
2013-11-18 11:52:57 Robie Basak bug added bug
2013-11-18 11:53:19 Robie Basak tags apport-bug armhf midway saucy apport-bug armhf bot-stop-nagging midway saucy
2013-11-18 11:54:14 Robie Basak description Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc" is close to epoch). Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices: total 0 crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules: binfmt_misc 7197 1 - Live 0x00000000 (F) rtc_pl031 4594 0 - Live 0x00000000 (F) uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F) uio_pdrv_genirq 3441 0 - Live 0x00000000 (F) xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions: linux-restricted-modules-3.11.0-13-generic-lpae N/A linux-backports-modules-3.11.0-13-generic-lpae N/A linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog: Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694) Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1 Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds. Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds.
2013-11-18 12:00:11 Brad Figg linux (Ubuntu): status New Incomplete
2013-11-18 12:07:00 Robie Basak linux (Ubuntu): status Incomplete Confirmed
2013-11-18 17:21:59 Joseph Salisbury linux (Ubuntu): importance Undecided Medium
2013-11-20 14:07:41 Paolo Pisati attachment added 0001-UBUNTU-Config-armhf-RTC_DRV_PL031-y.patch https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1252242/+attachment/3913267/+files/0001-UBUNTU-Config-armhf-RTC_DRV_PL031-y.patch
2013-11-20 14:34:45 Paolo Pisati description Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds. SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # here is when rtc_hctosys() is called, tries to open rtc0 to read the time value bu # since the driver for this rtc is compiled as a module, it's unavailable at this # time, this it fails to read it and fails to set the wall clock [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds.
2013-11-20 14:36:31 Paolo Pisati description SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # here is when rtc_hctosys() is called, tries to open rtc0 to read the time value bu # since the driver for this rtc is compiled as a module, it's unavailable at this # time, this it fails to read it and fails to set the wall clock [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds. SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but it's unavailable at this # time and so it fails to set the wall clock [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds.
2013-11-20 14:37:30 Paolo Pisati description SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but it's unavailable at this # time and so it fails to set the wall clock [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds. SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but the driver is unavailable at # this time so it fails to set the system time [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds.
2013-11-20 14:37:42 Paolo Pisati description SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but the driver is unavailable at # this time so it fails to set the system time [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds. SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but the driver is unavailable at # this time so it fails to set the system time [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds.
2013-11-20 14:37:56 Paolo Pisati description SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but the driver is unavailable at # this time so it fails to set the system time [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds. SRU Justification: Impact: the Linux kernel resets the wall clock (RTC_HCTOSYS=y) using the value read from a specific rtc device (RTC_HCTOSYS_DEVICE=rtc0) as a late_initcall() (see drivers/rtc/hctosys.c::rtc_hctosys()). That implies that the RTC_HCTOSYS_DEVICE must be available when rtc_hctosys() is called, making all the rtc drivers that are built as a module unsuitanle for this task. dmesg: ... [ 5.396605] /home/ppisati/ubuntu-saucy/drivers/rtc/hctosys.c: unable to open rtc device (rtc0) # rtc_hctosys() is called, it tries to open rtc0 but the driver is unavailable at this time so it fails to set the system time [ 10.609622] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 # later on the rtc driver is loaded, but it's too late ... ubuntu@m01:~$ date Wed Dec 31 19:25:24 EST 1969 Fix: compile in the rtc driver that your board uses to set the wall clock (pl031 on calxeda) - see the attached patch Test case: dmesg: ... [ 5.303860] rtc-pl031 fff35000.rtc: rtc core: registered pl031 as rtc0 [ 5.421639] rtc-pl031 fff35000.rtc: setting system clock to 2013-11-19 16:47:18 UTC (1384879638) ... when the rtc driver is correctly build-in, you should see something like this in your bootlog. -- Working on MAAS, I see midway machines boot on Saucy with an incorrect system time (close to epoch). I have tried various things, including using MAAS to make sure that the hardware clock was set correctly before installation. Despite this, I find that the hardware clock (as reported by "hwclock --utc") is correct, yet the system time ("date --utc") is close to epoch. Affects: Saucy linux-image-3.11.0-13-generic-lpae 3.11.0-13.20, util-linux 2.20.1-5.1ubuntu9. Below is my current understanding of the root cause and possible solutions. My understanding may not be accurate. Please correct any inaccuracies. This is just my current understanding; all I know is that it doesn't work :) In userspace, util-linux via /etc/init/hwclock.conf is involved with the RTC. But it doesn't use --hctosys. I can find nothing in userspace that takes responsibility for setting up the system time from the RTC. hwclock(8) says that --hctosys is "a good option to use in one of the system startup scripts.", but also that --systz is "is an alternate option to --hctosys that does not read the hardware clock, and may be used in system startup scripts for recent 2.6 kernels where you know the System Time contains the Hardware Clock time." So it appears to me that it is the kernel that is supposed to make sure the RTC is copied to the system clock on boot, or at least that this is the assumption that userspace is making. It's my understanding that this isn't happening because rtc_pl031 is a module. I assume that an RTC module load doesn't reset the system time. Or should it? It sounds like an evil side effect to me if it doesn't happen on boot. Perhaps there should be or there is a module parameter to make it do that, though? If so, I am unaware of it, or any userspace implementation of using that. I can see two broad solutions to this: 1) The kernel takes responsibility for doing this task, which AIUI we can do with CONFIG_RTC_DRV_PL031=y. This was the case with the linux-highbank package in Quantal, which I believe is why this appears to be a regression from MAAS' perspective. 2) Userspace takes responsibility for running "hwclock --hctosys", which case we need logic to figure out when this is necessary (AIUI, it isn't necessary for Intel, as the RTC driver is compiled in?) and how to arrange this. Other options: 3) Some kind of definition of the semantics (perhaps there is one and I'm missing it) and userspace asking the module to do it on module load, or an hwclock command after module load or something. I am concerned about coordinating the timing involved in this option, though. 4) fixrtc on the command line as a workaround for MAAS. This would need us to amend flash-kernel. But this doesn't really fix the problem; a --hctosys would still be needed to make the clock properly accurate. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: linux-image-3.11.0-13-generic-lpae 3.11.0-13.20 ProcVersionSignature: User Name 3.11.0-13.20-generic-lpae 3.11.6 Uname: Linux 3.11.0-13-generic-lpae armv7l AlsaDevices:  total 0  crw-rw---- 1 root audio 116, 1 Dec 31 1969 seq  crw-rw---- 1 root audio 116, 33 Dec 31 1969 timer AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.11.0-13-generic-lpae. AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.12.5-0ubuntu2.1 Architecture: armhf ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1: CRDA: Error: [Errno 2] No such file or directory: 'iw' Date: Mon Nov 18 06:33:34 2013 HibernationDevice: RESUME=UUID=1337d4f1-3df8-4589-9008-a47a197b579f IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99 MarkForUpload: True PciMultimedia: ProcFB: ProcKernelCmdLine: console=ttyAMA0 nosplash ProcModules:  binfmt_misc 7197 1 - Live 0x00000000 (F)  rtc_pl031 4594 0 - Live 0x00000000 (F)  uio 8483 1 uio_pdrv_genirq, Live 0x00000000 (F)  uio_pdrv_genirq 3441 0 - Live 0x00000000 (F)  xgmac 18035 0 - Live 0x00000000 (F) RelatedPackageVersions:  linux-restricted-modules-3.11.0-13-generic-lpae N/A  linux-backports-modules-3.11.0-13-generic-lpae N/A  linux-firmware 1.116 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog:  Nov 18 06:26:32 m22 dhclient: DHCPREQUEST of 10.193.24.144 on eth0 to 10.193.37.1 port 67 (xid=0xb672694)  Nov 18 06:26:32 m22 dhclient: DHCPACK of 10.193.24.144 from 10.193.24.1  Nov 18 06:26:32 m22 dhclient: bound to 10.193.24.144 -- renewal in 3558 seconds.
2013-11-20 14:38:36 Paolo Pisati nominated for series Ubuntu Saucy
2013-12-02 23:16:26 Brian Murray bug task added linux (Ubuntu Saucy)
2013-12-05 19:41:25 Launchpad Janitor branch linked lp:ubuntu/precise-proposed/linux-lts-saucy
2013-12-09 18:48:02 Brad Figg tags apport-bug armhf bot-stop-nagging midway saucy apport-bug armhf bot-stop-nagging midway saucy verification-needed-saucy
2013-12-10 10:01:50 Robie Basak tags apport-bug armhf bot-stop-nagging midway saucy verification-needed-saucy apport-bug armhf bot-stop-nagging midway saucy verification-done-saucy
2014-01-02 22:34:38 Launchpad Janitor linux (Ubuntu Saucy): status New Fix Released
2014-01-02 22:34:38 Launchpad Janitor cve linked 2013-2929
2015-02-03 20:56:09 Mathew Hodson cve unlinked 2013-2929
2015-02-03 20:56:42 Mathew Hodson tags apport-bug armhf bot-stop-nagging midway saucy verification-done-saucy apport-bug armhf midway saucy verification-done-saucy
2015-02-04 00:25:08 Ubuntu Foundations Team Bug Bot tags apport-bug armhf midway saucy verification-done-saucy apport-bug armhf midway patch saucy verification-done-saucy
2015-02-04 00:25:10 Ubuntu Foundations Team Bug Bot bug added subscriber Joseph Salisbury