[plug] suspend to ram

Brad Campbell brad at wasp.net.au
Wed Jul 12 20:46:11 WST 2006


William Kenworthy wrote:
> Hi Brad, that sounds neat.  Can you post the relevant part of
> hibernate.conf where I presume this is setup?

My hibernate conf is pretty much standard except for adding these clauses to common.conf

This is just a hack I use that records epoch time and battery percentage on resume so I can 
calculate some stats

OnResume 01 /home/brad/bin/recres

This turns bluetooth off on resume.. it sometimes forgets the state and thus needs to be turned on 1st

OnResume 01 /usr/bin/spicctrl -l1
OnResume 00 /usr/bin/spicctrl -l0

Again.. more stats guff

OnSuspend 01 /home/brad/bin/recsus

This is a relic from my experimenting with the cdpower stuff

OnSuspend 01 /home/brad/bin/cdpower on

Crank the cpu up to max for suspend

OnSuspend 01 echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

powernowd does not cope with suspend/resume sometimes.. kick it in the arse

OnResume 01 /etc/init.d/powernowd restart

sonypi does not cope either..

UnloadModules sonypi

but we can't unload it if the daemon is still running..

RestartServices sonypid

These bring my screen back after s2ram..

EnableVbetool yes
RestoreVbeStateFrom /var/lib/acpi-support/vbestate
SwitchToTextMode yes

my vbestate gets stored on cold boot by the ubuntu acpi stuff..

> Does libata fix the problem where powering off the cdrom (using
> sony_acpi) renders the cdrom useless until a clean boot, and sometimes
> kills the ide bus altogether?

OOoooo I'd not even thought to try that again.. play with it tonight..


Just enable libata and ata_piix libata driver.. disable all the ata stuff..

I have PowerdownMethod commented out in suspend.conf and I have my acpi scripts set up to echo 0 > 
/sys/power/suspend2/powerdown_method before calling hibernate when I want to really hibernate, and I 
echo 3 to it to enable s2ram after saving state to disk 1st..

I could just use s2ram also, but it's all so shiny and new I feel much better knowing its all safely 
suspended to disk just in case it refuses to come back. (Been playing with s2ram for weeks now and 
had it die enough times on older kernels just to be a little cautious).

I timed it at about 7-10 seconds to come back.. It has to re-init the optical drive and that seems 
to take a bit while it does a seek test.

I have some hacky scripts that should help me benchmark the suspended battery drain over the next 
week or so to see how long it will last, but last night I suspended at about 11pm with 48% left and 
this morning about 9am it woke up with about 15% left.. I wonder if some of the drivers are not 
suspending the hardware fully?


Brad
-- 
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams



More information about the plug mailing list