Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 78815 - Clock runs at double speed during ACPI sleep
Summary: Clock runs at double speed during ACPI sleep
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard: 2.6.11
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-20 07:22 UTC by Jakob Schiotz
Modified: 2005-03-02 08:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/usr/src/linux-2.6.10-r1/.config (.config,26.13 KB, text/plain)
2005-01-20 07:23 UTC, Jakob Schiotz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakob Schiotz 2005-01-20 07:22:30 UTC
On my IBM ThinkPad T30 running the development-sources-2.6.10-r1 kernel, the clock runs at double speed during ACPI sleep.  I am running an x86 system (as opposed to a ~x86 system).

When hibernating (swsusp) the clock does not run at all, this was expected.  But when I tested if this would also be the case during suspend to RAM (sleep), but surprisingly 30 minutes pass on the clock during a 15 minute suspend. :-(

Presumably, the kernel does not expect the clock to run, and adds the time elapsed on the hardware clock to the system clock.  Perhaps the code that should have done this for suspend to disk accidentally does it for suspend to ram in stead.

In case it is an IBM thing that the clock runs during suspend to ram, the kernel could easily test if approximately as much time has accumulated on the system clock as on the hardware clock, and refrain from adjusting the system clock if they are approximately equal.

PS.  I am in doubt if I should report this on the Gentoo bugzilla or on the Kernel bugzilla.  If I should report it directly to the kernel guys, please tell me.

Here is the script I use to suspend.  The /sbin/hwclock lines are there to compensate for this bug.

logger "suspend.sh called"
logger "Lid `cat /proc/acpi/button/lid/LID/state`"
logger "Software suspend to ram."
sync
/sbin/hwclock --systohc
chvt 1
radeontool light off
echo -n 3 >/proc/acpi/sleep
/sbin/hwclock --adjust
/sbin/hwclock --hctosys
logger "Woke up from suspend."
radeontool light on
chvt 7



Reproducible: Always
Steps to Reproduce:
1. Check that the system time is correct.
2. Press the suspend button, running the script above.
3. Wait a while (5-10 min at least).
4. Wake the system, and check the system time.

Actual Results:  
The system time will now be ahead by the same amount as the wait, i.e if I
waited 23 minutes the system clock looks like 46 minutes have elapsed.



demokrit acpi # emerge info
Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1,
2.6.10 i686)
=================================================================
System uname: 2.6.10 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r2
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
DISTDIR="/var/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/
ftp://trumpetti.atm.tut.fi/gentoo/ ftp://ftp.rhnet.is/pub/gentoo/
ftp://gd.tuwien.ac.at/opsys/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/var/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X Xaw3d acpi alsa arts atlas avi berkdb bitmap-fonts cdr crypt cups dga
dvd emacs encode fam flac font-server foomaticdb fortran gdbm gif gpm gtk
gtk2imagemagick imap imlib java jpeg kde libg++ libwww mad maildir mbox mikmod
motif mozilla mpeg mule ncurses netcdf nls nptl oggvobis oggvorbis opengl oss
pam pcmcia pdflib perl png pnp ppds python qt quicktime readline scanner sdl
slang spell sse ssl svga tcltk tcpd tetex tiff truetype truetype-fonts trusted
type1-fonts usb wxwindows xml2 xmms xv xvid zlib linguas_dk"
Comment 1 Jakob Schiotz 2005-01-20 07:23:25 UTC
Created attachment 49037 [details]
/usr/src/linux-2.6.10-r1/.config
Comment 2 Daniel Drake (RETIRED) gentoo-dev 2005-01-20 08:16:19 UTC
Please test with 2.6.11-rc1
Comment 3 Jakob Schiotz 2005-01-21 04:41:37 UTC
I tested it with 2.6.11-rc1

The bug is fixed in that version.  The clock advances normally during suspend to ram and suspend to disk.

Thanks!
Comment 4 Daniel Drake (RETIRED) gentoo-dev 2005-01-21 07:18:44 UTC
Ideally we want to backport the fix to 2.6.10...if we can find the patch. Reopening for now
Comment 5 Daniel Drake (RETIRED) gentoo-dev 2005-01-21 07:32:00 UTC
Could you please try patching 2.6.10 with this

http://linux.bkbits.net:8080/linux-2.6/gnupatch@41db7aefX9qeYIxgob_ViOppQEUBRw

It should solve the issue
Comment 6 Jakob Schiotz 2005-01-21 08:37:11 UTC
The patch fixes the double speed during suspend-to-ram, but it does not fix the clock not advancing during suspend-to-disk, which is also fixed in 2.6.11_rc1.  So there may be one more patch ....

/Jakob
Comment 7 Daniel Drake (RETIRED) gentoo-dev 2005-01-24 03:43:44 UTC
Can't spot any patches which might fix the other case.. will leave open for now. The patch referenced above will be included in next gentoo-dev-sources release
Comment 8 Christian Reiser 2005-02-12 19:05:47 UTC
Just wanted to state, that it is not an ACPI-Issue. I have the same problem (clock screw +suspendtime) using vanilla 2.6.10 with APM on an IBM Thinkpad 600e. Will try the patch asap.
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2005-03-02 08:51:17 UTC
gentoo-dev-sources-2.6.11 is now in portage