I had been trying for months, but I was finally able to do it. What you might ask was so complicated. Well, in this case it was getting my linux laptop to suspend. This had been a major annoyance that I couldn’t walk away from the laptop for awhile without worrying about the battery dying. The only way to handle this was to power the laptop down. If I closed the lid the laptop would suspend, but never come back. Seemed like the bios was trying to suspend, but it wasn’t speaking the same language as linux. I would finally have to pull the batteries just to get it to reboot.
So I was very excited several weeks ago when going through the options in compiling the new kernel when I found some options relating to software suspend. According to the brief description there was supposed to be a command to initiate this, swsusp. After some initial searching and coming up empty I finally found a post that mentioned an alternative way to initialize the process by using “echo -n “disk” > /sys/power/state”. A fellow engineer at a recent 106Miles meeting also clued me in to the fact that the mentioned swsusp command was just a shell script wrapper to this process.
So some initial testing got suspend to disk working right off the bat, but suspend to memory took some more work. I discovered that it could be a bit cranky about running processes when it attempts to suspend. Found out from the syslog that I needed to shutdown mysql before attempting the suspend. So a two line shell script later and I have a working suspend method.
Now the test was to bring the laptop back up again. With this, everything worked great except for the usb mouse. The laptop I’m working on is an old Dell C600 that I bought used off of Ebay 2 years ago. The built in mouse pad died horribly about a year ago requiring that I use an external mouse. So, after about 2 hours of more studying I found that doing a simple “rmmod uhci_hcd; modprobe uhci_hcd;” would reinitialize the usb mouse. So, now we have a working linux laptop again. Even the linksys wireless card would come back up and hop on my home’s network. Couldn’t be happier.
The only caveat with the process is that with the memory suspend it seems to get stuck in the middle of the shutdown process about 10% of the time. No real reason that I can discern and only pulling the batteries will get you out of this state. Haven’t seen this happen with the disk suspend yet, so I’ll probably be sticking with that as I only use this laptop for development work at night now. Most casual laptop usage is now on my Apple iBook which suspends perfectly, one of the nicest things about it.