# suspend to ram :: gentoo vs ubuntu

## jancici

hi

I have got HP laptop nc6220. I am not able to get suspend-to-ram working. I did try few weeks ago but I was not succesfull so I did leave it.

I did install new UBUNTU on another partition few days ago and suspend-to-ram is working.

PLEASE if you have any idea what I should check or compare with UBUNTU, write that, thanks

I am using hibernate-ram script and kernel : 2.6.18-gentoo-r6

this is my /etc/hibernate/common.conf

```
Verbosity 2

LogFile /var/log/hibernate.log

LogVerbosity 2

# LogTimestamp yes

# AlwaysForce yes

# AlwaysKill yes

# HibernateVT 15

Distribution gentoo

# XDisplay :0

### 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

# see http://bugs.debian.org/317479

# RemountXFSBoot yes

### hardware_tweaks

# IbmAcpi yes

# Runi855resolution yes

# FullSpeedCPU yes

### lilo

# EnsureLILOResumes yes

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

# LockConsoleAs root

# LockXScreenSaver yes

# LockGnomeScreenSaver yes

# LockKDE yes

# LockXLock yes

# LockXAutoLock yes

### misclaunch

#OnSuspend 20 echo "!!!!!!!!!!!!!!     dobru noc     !!!!!!!!!!!!!!!!!!"

#OnResume 20 echo "!!!!!!!!!!!!     dobre rano    !!!!!!!!!!!!!!!"

### modules

# UnloadModules snd_via82cxxx usb-ohci

# UnloadAllModules yes

UnloadBlacklistedModules yes

LoadModules auto

# LoadModulesFromFile /etc/modules

### modules-gentoo

# GentooModulesAutoload yes

### network

DownInterfaces eth0 eth1

# UpInterfaces auto

### pause_audio

# MuteAudio yes

# PauseAudio yes

### pcmcia

# EjectCards yes

### programs

# IncompatiblePrograms xmms

### services

# RestartServices laptop_mode

StopServices alsasound

StartServices alsasound

### vbetool

EnableVbetool yes

RestoreVbeStateFrom /var/lib/vbetool/vbestate

VbetoolPost yes

RestoreVCSAData yes

### xhacks

SwitchToTextMode yes

# UseDummyXServer yes

# DummyXServerConfig xorg-dummy.conf

```

/etc/hibernate/ram.conf

```
TryMethod ususpend-ram.conf

TryMethod sysfs-ram.conf

EnableVbetool yes

VbetoolPost yes
```

/etc/hiberanate/usespend-ram.conf

```
USuspendMethod ram

# if needed, pass the -f option to s2ram

# USuspendRamForce yes

Include common.conf
```

I have installed 

```
sys-apps/vbetool-0.7

sys-power/hibernate-script-1.94-r1

```

----------

## Need4Speed

what's the ouput of:

```
cat /sys/power/state
```

----------

## jancici

```
 cat /sys/power/state

mem
```

sorry I forgot kernel config

```
# Power management options (ACPI, APM)

#

CONFIG_PM=y

# CONFIG_PM_LEGACY is not set

# CONFIG_PM_DEBUG is not set

# CONFIG_SOFTWARE_SUSPEND is not set

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set

CONFIG_ACPI_AC=m

CONFIG_ACPI_BATTERY=m

CONFIG_ACPI_BUTTON=m

CONFIG_ACPI_VIDEO=m

CONFIG_ACPI_HOTKEY=m

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=m

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_IBM is not set

# CONFIG_ACPI_TOSHIBA is not set

# CONFIG_ACPI_CUSTOM_DSDT is not set

CONFIG_ACPI_BLACKLIST_YEAR=2000

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

CONFIG_X86_PM_TIMER=y

# CONFIG_ACPI_CONTAINER is not set

# CONFIG_ACPI_SBS is not set

#

# APM (Advanced Power Management) BIOS Support

#

# CONFIG_APM is not set
```

----------

## Need4Speed

```
echo -n "mem" > /sys/power/state
```

doesn't work?

----------

## Tlaloc

Gentoo provides extra suspend2 sources, too. Maybe you have more luck with them (I didn't when I last tried, nx8220 never resumed from suspend to ram, but that was several months ago).

Bye, Val.

----------

## jancici

suspend to disk = hibernate :: working 

suspend to ram = sleep or suspend :: can't resume

- there is a software suspend in kernel which is doing suspend to disk - let;s call that suspend1

- suspend2 is another way of suspend to disk- yes I did try that sources and suspend to disk is working well

- I did write that suspend-to-ram is not working; welll I did forgot to write more details

I can suspend to ram {power led is blinking}

but problem is with resuming

yes

```
echo -n "mem" > /sys/power/state
```

is sleeping laptop, but I know that it is NOT enough, you need do some work before and after

I am using hibernate-ram script because all that work can be done by that script

seems that I have to study how they done that in UBUNTU

----------

## Need4Speed

I guess my laptop must have something in the BIOS that brings it out of Suspend-to-RAM because I just use that line to make it sleep and then push the power button to wake it up.

----------

## Tlaloc

Have you seen this?

http://gentoo-wiki.com/HARDWARE_Gentoo_on_HP_Compaq_nc6220

Bye, tira.

----------

## jancici

yes I was reading that wiki page few times

I did browse there again and there some new TIP about suspend to ram, there is a kernel patch for IDE driver

well seems that's working but when laptop resume X is crashing and it is restarting itself in cycle, 

this is in X.org log at the end

```
Error in I830WaitLpRing(), now is -753432978, start is -753434979

pgetbl_ctl: 0x3ffc0001 pgetbl_err: 0x3

ipeir: 0 iphdr: 8000d43

LP ring tail: f8 head: 0 len: 1f001 start 0

eir: 0 esr: 10 emr: ffff

instdone: ffc1 instpm: 0

memmode: 108 instps: 2014c1

hwstam: fffe ier: 22 imr: 8 iir: 0

space: 130816 wanted 131064

Fatal server error:

lockup

Error in I830WaitLpRing(), now is -753430976, start is -753432977

pgetbl_ctl: 0x3ffc0001 pgetbl_err: 0x3

ipeir: 0 iphdr: 8000d43

LP ring tail: 100 head: 0 len: 1f001 start 0

eir: 0 esr: 10 emr: ffff

instdone: ffc1 instpm: 0

memmode: 108 instps: 2014c1

hwstam: fffe ier: 22 imr: 8 iir: 0

space: 130808 wanted 131064

FatalError re-entered, aborting

lockup
```

EDIT:

I did boot back to UBUNTU : resuming did stop to work, in X.log is same error

----------

## taborda

hi i have the same problem here but the suspend to ram was working before i install the suspend2-sources

did you solved the problem?

----------

## PaulBredbury

I suggest trying the Ubuntu kernel.

----------

## Buddman

I've been having this problem with my Dell E1705 and Gentoo for a very long time and gave up on a solution (problem being I couldn't get resume working after suspend to ram).  Is it really a kernel issue??  I'll have to install Gentoo and give it a shot, but would like to know if this solved the problem.

----------

## taborda

back to sources without suspend2 and unmerged vbetool and suspend2-userui now hibernate to ram is workind  :Very Happy: 

----------

## jancici

what version of :

- gentoo-sources 

- Xorg

- drivers of graphics card

are you using?

----------

## taborda

gentoo-sources-2.6.21-r3

xorg-x11-7.2

xorg-server-1.2.0-r3

ati-drivers-8.37.6-r1

reinstalled suspend2-userui-0.7.1 and hibernate to ram is working...

do not have hibernate to disk

----------

## deStilaDo

I had the same problem.

Suspend-to-ram used to work with gentoo-sources.

After installing suspend2-sources, hibernate (suspend-to-disk) is working but suspend-to-ram is not anymore.

So, I found a script on the web that solved the problem. I think I should integrate it with hibernate-script so I can use the hibernate-ram command, but I just didn't had the time yet.

Sorry my poor english. Here is the script that made suspend-to-ram work after installing suspend2-sources:

```
#!/bin/sh

# discover video card's ID

ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# securely create a temporary file

TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`

trap 'rm -f $TMP_FILE' 0 1 15

# switch to virtual terminal 1 to avoid graphics

# corruption in X

chvt 1

# write all unwritten data (just in case)

sync

# dump current data from the video card to the

# temporary file

cat /proc/bus/pci/$ID > $TMP_FILE

# suspend

echo -n mem > /sys/power/state

# restore video card data from the temporary file

# on resume

cat $TMP_FILE > /proc/bus/pci/$ID

# switch back to virtual terminal 7 (running X)

chvt 7

# remove temporary file

rm -f $TMP_FILE
```

Fabiano.

----------

## deStilaDo

I forgot to mention, I got a HP dv2120us.

If someone has a close hardware and need some configs, just ask.

It's a AMD Turion(tm) 64 X2 with a Geforce 6150 Go.

```
turion ~ # lspci 

00:00.0 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)

00:00.1 RAM memory: nVidia Corporation C51 Memory Controller 0 (rev a2)

00:00.2 RAM memory: nVidia Corporation C51 Memory Controller 1 (rev a2)

00:00.3 RAM memory: nVidia Corporation C51 Memory Controller 5 (rev a2)

00:00.4 RAM memory: nVidia Corporation C51 Memory Controller 4 (rev a2)

00:00.5 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)

00:00.6 RAM memory: nVidia Corporation C51 Memory Controller 3 (rev a2)

00:00.7 RAM memory: nVidia Corporation C51 Memory Controller 2 (rev a2)

00:02.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1)

00:03.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1)

00:05.0 VGA compatible controller: nVidia Corporation C51 [Geforce 6150 Go] (rev a2)

00:09.0 RAM memory: nVidia Corporation MCP51 Host Bridge (rev a2)

00:0a.0 ISA bridge: nVidia Corporation MCP51 LPC Bridge (rev a3)

00:0a.1 SMBus: nVidia Corporation MCP51 SMBus (rev a3)

00:0a.3 Co-processor: nVidia Corporation MCP51 PMU (rev a3)

00:0b.0 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)

00:0b.1 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)

00:0d.0 IDE interface: nVidia Corporation MCP51 IDE (rev f1)

00:0e.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev f1)

00:10.0 PCI bridge: nVidia Corporation MCP51 PCI Bridge (rev a2)

00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)

00:14.0 Bridge: nVidia Corporation MCP51 Ethernet Controller (rev a3)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 Network controller: Broadcom Corporation BCM94311MCG wlan mini-PCI (rev 01)

03:09.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller

03:09.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)

03:09.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)

03:09.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)

03:09.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)
```

I had to add this line do xorg.conf, in Section "Device":

```
Option          "VBERestore"    "true"
```

About the file /etc/hibernate/blacklisted-modules, I commented out the line "nvidia" and added a line "uvcvideo".

I hope it helps,

Fabiano.

----------

