diff options
author | jkim <jkim@FreeBSD.org> | 2010-08-13 20:43:19 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-08-13 20:43:19 +0000 |
commit | 0622ee44e502fcb6534c4d84f1a289fed09a363f (patch) | |
tree | 8a4b904d29030e871a1644046485cb4466226cc3 /etc/rc.suspend | |
parent | d713120364aa9a24581ed1d5780d41cdfc42339c (diff) | |
download | FreeBSD-src-0622ee44e502fcb6534c4d84f1a289fed09a363f.zip FreeBSD-src-0622ee44e502fcb6534c4d84f1a289fed09a363f.tar.gz |
Enforce ACPI timer as the timecounter hardware before we change sleep state
unless it is the current timer. When we have resumed successfully, restore
the previous timecounter hardware if it was changed earlier. Only the ACPI
timer is guaranteed to increase monotonically between S-state changes.
Diffstat (limited to 'etc/rc.suspend')
-rwxr-xr-x | etc/rc.suspend | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/etc/rc.suspend b/etc/rc.suspend index 7b08d31..890e50a 100755 --- a/etc/rc.suspend +++ b/etc/rc.suspend @@ -43,6 +43,18 @@ fi echo $$ 2> /dev/null > /var/run/rc.suspend.pid +_t=`/sbin/sysctl -n kern.timecounter.hardware 2> /dev/null` +case ${_t#ACPI-} in +fast|safe) + /bin/rm -f /var/run/rc.suspend.tch + ;; +*) + ( /sbin/sysctl -n kern.timecounter.hardware=ACPI-fast || \ + /sbin/sysctl -n kern.timecounter.hardware=ACPI-safe ) \ + > /dev/null 2>&1 && echo $_t > /var/run/rc.suspend.tch + ;; +esac + # If you have troubles on suspending with PC-CARD modem, try this. # See also contrib/pccardq.c (Only for PAO users). # pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \ |