This howto comes with no warranty. I am not responsible for any data loss, hardware failures or any other problems.
For those who can't wait:
Gentoo users: Use X.Org >= 6.8.0 with the "radeon" driver and suspend from X and you'll be fine.
After some hacking I managed to get ACPI suspend-to-ram working on my Acer
Travelmate 803 LCiB Notebook. Here I describe what needs to be done.
This howto applies to Acer Travelmate 800 series notebook and propably other
notebooks too.
Especially the part about the radeon card will be interesting for owners of other notebooks.
Version 2.5 is really short because S3 works quite nice with a few patches.
With Version 3 the howto could have a lenght of 3 lines.
With an up-to-date Kernel you basically need only a small patch and some tool to reboot the video card.
V 1.0: 8.4.2004(hopefully): Initial version
V 1.1: 23.4.2004: Fixed some spelling mistakes.
V 1.2: 25.4.2004 Included a patch for radeon_driver.c against Xfree 4.4.0.
V 2.0: 16.7.2004: A lot of updates. No X11 patch needed any more.
V 2.5: 29.08.2004: Again a lot of good news, S3 works pretty well now
V 3.0: 07:03:2005: A LOT OF UPDATES, S3 works even more better now.
V 3.1: 29.7.2005: Updated to Kernel 2.6.12, no kernel patch needed
The latest version is available at http://www.doesi.gmxhome.de/linux/tm800s3/s3.html.
It's not working perfectly yet, some devices and drivers still make problems. You can get all devices working with some effort, so don't be shocked when looking at the troublemakers list.
Troublemakers:
You have to use the plain text console, if frame buffer console support(fbcon) is loaded the system won't resume.
A user mode program is necesary to reset the Video bios, and there's also a patch for XFree/X.Org available. I heard that this patch is included in X.Org 6.8.2.
3D Acceleration tends to be unstable with certain games after resume.
You have to unload the usb-ehci module, otherwise your system will refuse to suspend.
I also recommend to unload the usb-uhci driver
Works quite nice, but resumes slowly sometimes.
Not tested intensively, but didn't cause any problems so far.
The acerhk modules needs to be re-loaded after resume to re-enable the dritek keyboard extensions.
Flawlessly working devices:
I use Linux 2.6.12 with the following configuration:
With Kernel >= 2.6.12 there is no patch needed. I don't know what was changed in the kernel, it was not my patch which was applied. Anyway, S3 works without kernel patches now.
For previous kernels you need a small patch for the kernel to make S3 work. It introduces 2 new suspend functions, pm_ops.setup and pm_ops.leave. The main use is to call acpi_leave_sleep_state and acpi_leave_sleep_state before the PCI devices are resumed. I've sent this patch to the acpi developers, but it's not included in the mainline yet(as of March, 7. 2005).
Re-compile and install your kernel and modules, then you are ready for the first test.
The video bios has to be re-booted after resume, which is done by a real mode int10 call. Fore some reason this can't be done by a kernel driver(radeonfb), but X11 can do this.
Gentoo users: The X.org ebuilds include the patch mentioned below. You don't need to do anything, just use the "radeon" driver and suspend from X.
All users: Rumors say that this patch is in X.org mainline now(X.Org 6.8.2). Can someone verify this?
Aman Gupta wrote a small program which uses the lrmi libraries to reset
the video bios. You can download the source or a binary. You have to install the lrmi library
to use it. Your distibution should provide a package. Compile the source with
`gcc boot-radeon.c -o boot-radeon -llrmi`
Copy the program somewhere, e.g. /sbin and exectute if to reset the card. Note that you have to switch from X11 to console before resetting the Vbios.
#/usr/bin/chvt 1
#/sbin/boot-radeon
#/usr/bin/chvt 7
The provided suspend script performs this steps.
If you are using gentoo or any other distribution which supports compiling from source, you can start the installation, interrupt it after the sources are unpacked(Press strg+Z), patch radeon_driver.c and then continue the installation(run "fg"). This makes compiling X11 a lot easier.
I use Xfree 4.4, but if you don't want this you can theoretically use any other version too.
See www.xfree.org for download instructions.
You may also use X.Org. X.Org 6.8.2 is said to have this patch included.
You can find the patch file here. It's a patch against Xfree 4.4.0. If you use another version and this patch doesn't apply, you can patch your radeon_driver.c by hand.
Download this radeon_drv.o and copy
it to /usr/X11R6/lib/modules/drivers/radeon_drv.o. Make a backup copy of your
old radeon_drv.o before.
This file is compiled for XFree 4.4, so Xfree might refuse loading it.
Extract this Xfree server binrary to
/usr/X11R6/bin/XFree86 if your server doesn't start.(Backup before replacing
the original server). This might cause other version conflicts.
If using the binrary file fails, restore your original files.
ATI's binary driver(fglrx) doesn't work with any type of suspend. You should use the "radeon" driver if you want S3 or S4
Well, you may use fglrx, but you have to disable DRI before you start X. You have to reboot your card with one of the user space utils. After resume you won't have any hardware acceleration!
I have written to ATI about this issue and they say that they are aware of this issue. Maybe newer drivers work. fglrx 8.10.19 does not work.
If you need the fglrx driver for gaming(IMO it has much better DRI support) than I recommend you to switch between the 2 drivers.
Ok, if everything is in place you can give it a try. Make sure that you booted your new kernel. I use the following script to suspend:
#/bin/bash
chvt 1
rmmod ehci-hcd
rmmod uhci-hcd
echo performance >
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 3 > /proc/acpi/sleep
echo powersave >
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sbin/boot-radeon
modprobe uhci-hcd
modprobe ehci-hcd
chvt 7
/etc/init.d/acertm restart
If you use the X11 patch(Gentoo!) then you can remove the chvt lines and the call to /sbin/boot-radeon. I recommend you to unload the usb modules. ehci-hcd has made troubles. uhci-hcd should work basically, but if it's loaded you can't plug usb devics while suspended. uhci-hcd will crash your system on resume.
I also don't know if the cpufreq governor switches are still necessary. I inserted them when I used 2.6.9.
Again: No warranty!
USB is stopped before suspend and completely restarted, so can change usb devices without problems.
This problem didn't occur with recent kernels any more, but I can't promise that the problem is fixed.
The DRI acceleration with the radeon driver tends to be unstable after resume with certain games(e.g. tuxracer). Restarting X11 seems to fix this.
Martin Lehofer(martin.lehofer (at) gmx.at has S3 working with Debian. He told me that a few changes in the suspend script were necessary. You may contact him for debian-specific questions.
This is what he wrote me(in german):
komischerweise gibt es noch keine debian-pakete für xfree4.4, das aber bei mir zumindest ohne probleme läuft. zu beachten ist dass das paket libpam0g-dev installiert sein muss (mit)
# apt-get install libpam0g-dev
und falls das touchpad nicht funktioniert (keine synaptics-treiber, aber daran arbeite ich noch)
# modprobe psmouse
standby funktioniert auch nicht wenn irda aktiviert ist, also
# /etc/init.d/irda stop
überhaupt erledigen folgende befehle schon das entladen einiger module:
# /etc/init.d/hotplug stop
# /etc/init.d/alsa stop
man sollte auf alle fälle vorheru auf den ipw2100 treiber umsteigen, da
(zumindest bei mir) das entladen von ndiswrapper das system abstürzen lässt.
auch habe ich den aktuellen CVS-Baum von xfree nicht zum kompilieren
gebracht, also am besten den vorgepackten source nehmen.
My mail address is stefandoesinger_nospam_@gmx.at
(remove the _nospam_ from the address).
I had no bad experience with html mails so far, so I accept them.