Acer Travelmate 800 suspend-to-ram howto

Disclaimer:

This howto comes with no warranty. I am not responsible for any data loss, hardware failures or any other problems.

Short summary

For those who can't wait:

  1. Kernel >= 2.6.12. No patch needed any more
  2. Recompile your kernel with USB compiled as modules. Don't forget to reboot
  3. Select a tool to reboot your video card from the "Radeon Card" section

    Gentoo users: Use X.Org >= 6.8.0 with the "radeon" driver and suspend from X and you'll be fine.

  4. Before S3 unload uhci_hcd and uhci_hcd
  5. echo 3 > /proc/acpi/sleep
  6. If it doesn't work read the long version

Preface

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.

Version history:

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.

Working and not working devices

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:

Flawlessly working devices:

Software requirements

Kernel Configuration

I use Linux 2.6.12 with the following configuration:

Kernel patches

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 radeon card.

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?

Alternative 1: Use the stand alone tool

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.

Old Alternative 2: Re-compile X11

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.

  1. Download a X11 source version.

    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.

  2. Unpack the source
  3. patch xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c

    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.

  4. Configure, compile and install Xfree. See www.xfree.org or the installation instructions on how to do this.

Old Alternative 3: Use my pre-compiled radeon_drv.o

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.

Informal: ATI's binary driver

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.

How to suspend

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.

Notes about S3

Other distibutions:

Debian

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.

Contact:

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.