# Suspend-to-RAM S3 with ATI Radeon

## menschmeier

Hi,

yesterday I made sustend-to-disk avalable on my laptop (Samsung P30, video card: VGA compatible controller: ATI Technologies Inc M9+ 5C63 [Radeon Mobility 9200 (AGP)] (rev 01)), today I am trying to get Suspend-to-disk. I found some topics about S3 on systems with ATI cards.

So I tried to go the simplest and easiest way, but I can not make it work - hibernate with vbetool. Maybe someone can tell me what I have done wrong and give me a hint.

What I did:

1. using vanilla-kernel 2.6.11 patched with software-suspend-2.1.9-for-2.6.11

2. emerge vbetool

3. as described here https://forums.gentoo.org/viewtopic-t-303672-start-0-postdays-0-postorder-asc-highlight-vbetool.html I run a script containing

```
#!/bin/bash

statedir=/root/s3/state

mkdir -p $statedir

chvt 2

sleep 1

vbetool vbestate save >$statedir/vbe 
```

4. copied /root/s3/state/vbestate to /var/lib/vbetool/vbestate

5. I configured /etc/hibernate/ram.conf. 

```
# Example ram.conf file for suspending to RAM. Adapt to your own tastes.

# Options are not case sensitive.

#

# Run "hibernate -h" for help on the configuration items.

### sysfs_power_state

UseSysfsPowerState mem

##############################################################################

### Some global settings

##############################################################################

Verbosity 3

LogFile /var/log/hibernate.log

LogVerbosity 1

# AlwaysForce yes

# AlwaysKill yes

# HibernateVT 15

# Distribution debian (not required - autodetection should work)

XDisplay :0

##############################################################################

### Scriptlets

###   Scriptlets provide support for doing all sorts of things before and after

###   suspending. The defaults settings here should work for most people, but

###   you may wish to edit these to taste. Consult "hibernate -h" for help on

###   the configuration settings.

##############################################################################

### bootsplash

## If you use bootsplash, also enabling SwitchToTextMode is recommended if

## you use X, otherwise you may end up with a garbled X display.

# Bootsplash on

# BootsplashConfig /etc/bootsplash/default/config/bootsplash-1024x768.cfg

### clock

SaveClock restore-only

### devices

# IncompatibleDevices /dev/dsp /dev/video*

### diskcache

# DisableWriteCacheOn /dev/hda

### fbsplash (enable SwitchToTextMode if you use this)

# FBSplash on

# FBSplashTheme suspend2

### filesystems

# Unmount /nfsshare /windows /mnt/sambaserver

UnmountFSTypes smbfs nfs

# UnmountGraceTime 1

# Mount /windows

### grub

ChangeGrubMenu yes

GrubMenuFile /boot/grub/menu.lst

# AlternateGrubMenuFile /boot/grub/menu-suspended.lst

# BackupGrubMenuFile /boot/grub/menu.lst.hibernate.bak

### hardware_tweaks

# IbmAcpi yes

RadeonTool yes

### lilo

# EnsureLILOResumes yes

### lock (generally you only want one of the following options)

# LockConsoleAs root

# LockXScreenSaver yes

LockKDE yes

### misclaunch

# OnSuspend 20 echo "Good night!"

# OnResume 20 echo "Good morning!"

### modules

# UnloadModules snd_via82cxxx usb-ohci

# UnloadAllModules yes

UnloadBlacklistedModules yes

LoadModules auto

# LoadModulesFromFile /etc/modules

### modules-gentoo

GentooModulesAutoload yes

### network

DownInterfaces auto

UpInterfaces auto

### programs

# IncompatiblePrograms xmms

### services

RestartServices laptop_mode ntp-client netmount nfsmount ntpd

# StopServices alsasound

# StartServices aumix

### vbetool

EnableVbetool yes

RestoreVbeStateFrom /var/lib/vbetool/vbestate

VbetoolPost yes

### xhacks

SwitchToTextMode yes

# UseDummyXServer yes

### xstatus

## This can be set to gnome, kde or x:

XStatus kde

# XSuspendText Preparing to suspend...

# XResumeText Resuming from suspend...

## When using XStatus x, and you have xosd installed:

# XosdSettings --font -misc-fixed-medium-r-semicondensed--*-120-*-*-c-*-*-* --colour=Green --shadow 1 --pos bottom --align center --offset 50
```

6. called /usr/sbin/hibernate-ram to suspend the system to RAM, the system went down, power turned off, this thake about 5 seconds.

7. Swtching the system on again by pressing the power button, the result is a black screen, I have to power down and reboot

8. The log file /var/log/hibernate shows the following data:

```
hibernate-ram: [01] Executing CheckLastResume ...

hibernate-ram: [01] Executing LockFileGet ...

hibernate-ram: [01] Executing NewKernelFileCheck ...

hibernate-ram: [05] Executing XStatusSuspendBegin ...

hibernate-ram: [10] Executing EnsureSysfsPowerStateCapable ...

hibernate-ram: [11] Executing ChangeGrubMenu ...

Changing grub menu...

hibernate-ram: [11] Executing XHacksSuspendHook1 ...

hibernate-ram: [20] Executing XStatusProgress ...

hibernate-ram: [30] Executing ServicesStop ...

Executing /etc/init.d/laptop_mode stop

 * Stopping laptop_mode ...                                                                                    [ ok ]

Executing /etc/init.d/ntp-client stop

Executing /etc/init.d/netmount stop

 * Unmounting network filesystems ...                                                                          [ ok ]

Executing /etc/init.d/nfsmount stop

 * Unmounting NFS filesystems ...                                                                              [ ok ]

 * Stopping NFS statd ...                                                                                      [ ok ]

Executing /etc/init.d/ntpd stop

 * Stopping ntpd ...                                                                                           [ ok ]

hibernate-ram: [30] Executing XStatusProgress ...

hibernate-ram: [40] Executing XStatusProgress ...

hibernate-ram: [45] Executing FSTypesUnmount ...

hibernate-ram: [50] Executing XStatusProgress ...

hibernate-ram: [60] Executing NetworkStop ...

Bringing down interface eth1

hibernate-ram: [60] Executing XStatusProgress ...

hibernate-ram: [70] Executing XStatusProgress ...

hibernate-ram: [80] Executing XStatusProgress ...

hibernate-ram: [89] Executing SaveKernelModprobe ...

Saved /proc/sys/kernel/modprobe is /sbin/modprobe

Saved /proc/sys/kernel/hotplug is /sbin/hotplug

hibernate-ram: [90] Executing XStatusProgress ...

hibernate-ram: [91] Executing LockKDE ...

Locking .DCOPserver_moon__0

Locking .DCOPserver_moon__0

hibernate-ram: [91] Executing ModulesUnloadBlacklist ...

Unloading blacklisted modules listed /etc/hibernate/blacklisted-modules

Module version for ipw2100 is 65792

Module version for ipw2200 is

Module version for ndiswrapper is

hibernate-ram: [95] Executing XHacksSuspendHook2 ...

xhacks: changing console from 7 to 15

hibernate-ram: [95] Executing XStatusProgress ...

hibernate-ram: [97] Executing VbetoolSaveState ...

hibernate-ram: [98] Executing RadeonToolBacklightOff ...

'radeontool' utility not found. Radeontool disabled.

hibernate-ram: [98] Executing XStatusProgressKill ...

hibernate-ram: [99] Executing DoSysfsPowerStateSuspend ...

hibernate-ram: Activating sysfs power state mem ...

```

Does anyone know what I have done wrong? I am not very sure about the ram.config. I am not sure if I still have to run the script I mentioned in point 3.

Thanks for any hints or advices

menschmeier

----------

## ekutay

Logfile looks alright. Presumtively you can also login blind and run 

```
halt
```

or press CTRL-ALT-DEL.

Don't know any of these scripts, mine is just 20 lines  :Wink: . Anyhow you should try to play around with acpi parameters passing to your kernel during startup. I had similar issues, which were related to reinitialization of my graphic card. For me best working kernel append is acpi_sleep=s3_bios,s3_mode, but could be different in your case.

There are also suspend-sources in portage, but I haven't checked, whether I wouldn't need these bootparams.

----------

## menschmeier

Hm,

the system is frozen when I try to resume, only the power button is working then.  :Crying or Very sad: 

I read on this forum and some other sites theat the ati driver and the framebuffer can cause this behaviour.

I am not using the "closed" ati driver, I am using the one coming with xorg. Now I try to compile a kernel without framebuffer support. Maybe this helps.

What I do not unterstand is how the resume works. What should happen when the system resumes from suspend-to-ram? Maybe someone can explain me in few word how suspend-to-ram and the resume works. Maybe this helps me to understand this problem.

Thanx

menschmeier

----------

## ph03n1x

The framebuffer thing is the following:

When u use the ati framebuffer driver in the kernel and the proprietary x-driver from ati your console is messed up when u switch from x to a console.

Referring to your black screen, I've read that the ati-drivers don't support suspend. What you can do is unloading the driver before going to suspend and reload it when system wakes up. that way it was said to work. You might have to write a little script though.

----------

## menschmeier

Hi,

OK, with a kernel without framebuffer it is a little better, now only the display is ike a rainbow ... but this system is not frozen ...

But how can I unload the driver? As I said I am using the driver coming with xorg. Here the modules I have loaded:

```
Module                  Size  Used by

ehci_hcd               30472  0

usb_storage            29120  0

usbcore               107384  3 ehci_hcd,usb_storage

cryptoloop              3136  0

ipw2100               145732  0

firmware_class          7808  1 ipw2100

ieee80211              37060  1 ipw2100

ieee80211_crypt         4484  2 ipw2100,ieee80211
```

menschmeier

----------

## ph03n1x

```
If you do not need DRI and OpenGL acceleration, you can use the open source "radeon" driver. Software Suspend 2 works fine with this driver, even without quitting X11. Just replace the driver "fglrx" with "radeon" in you XF86Config-4
```

Are you using this driver?

Found here:

http://localhost.ruhr.de/~stefan/acerTM292/

----------

## menschmeier

Hi,

yes I am using this on, here the part of my xorg.conf:

```
Section "Device"

    Identifier  "My Video Card"

    Driver      "radeon"

EndSection
```

Hm, software suspend works good with S4 (suspend-to-disk, hibernate), but now I am struggling with S3. But thank you for the link you sent, maybe there is an error in my hinbernate.conf/ram.conf I will figure it out.

menschmeier

----------

