[ltp] Possibly Solved: i855-based ThinkPad R51 suspend-to-RAM

Andrew Barr linux-thinkpad@linux-thinkpad.org
Wed, 13 Apr 2005 21:32:29 -0400


I think I might have solved the suspend-to-RAM issue with i855-based R51s. The 
theory I've come up with fits nicely with the reports I've seen: namely that 
a BIOS upgrade borked this functionality.

An explaination and context follows. If you just want to try out what I did, 
see the script that follows this message. You'll need the vbetool program. 
Edit the script if your graphics device doesn't reside at 00:02.0 (I suspect 
it does, most Intel chipsets I've seen have it there).

I discovered the other day that the graphics device, PCI device 00:02.0, 
doesn't come out of D3 suspend mode (see for yourself, ssh in after resume 
and run this command: "lspci -vvv -s 00:02.0". Look at the Status: line under 
Capabilities). This is due, I believe, to the lack of a PM-capable 
kernel-mode driver for the graphics device. The theory I have is that the 
BIOS puts the graphics device into D3, but the new BIOS doesn't wake it up 
anymore. I assume this is theoretically the responsibility of the Windows 
driver. It is unresponsive to POSTing from the video_post or vbetool programs 
at this point.

The solution I've found is to save the PCI configuration space and video state 
of the graphics device to disk before suspend and restore it immediately 
after waking up, then POST the graphics device. The script below works for me 
on kernel 2.6.10 (probably others too, but untested). It does work within 
X11, but I need to switch to text mode and back before my desktop is 
restored. I don't have a framebuffer console configured right now, so that's 
untested.

If people with i855-based R51s who can't get suspend-to-RAM to work with newer 
BIOSes would test this script for me and let me know if this works on a more 
broad scale, I'd appreciate it.
 
--
Andrew Barr
Student, Ohio State University

[firstname][lastname]@columbus.rr.com | [lastname].156@osu.edu
http://home.columbus.rr.com/andrewbarr

"Everyone is entitled to their own opinions, but not their own facts."
	- Daniel Patrick Moynihan

#!/bin/bash

logger "s3test: saving video state and PCI config space."
vbetool vbestate save > /var/cache/video.state
cat /proc/bus/pci/00/02.0 > /var/cache/video.config

logger "s3test: entering state"
echo -n mem > /sys/power/state
logger "s3test: back from state"

logger "s3test: restoring PCI config space and video state."
cat /var/cache/video.config > /proc/bus/pci/00/02.0
cat /var/cache/video.state | vbetool vbestate restore

logger "s3test: POSTing device."
vbetool post

logger "s3test: removing temporary files."
rm -rf /var/cache/video.config
rm -rf /var/cache/video.state

logger "s3test: success!"