# SOLVED: Laptop doesn't awake from sleep (suspend to ram)

## Q-collective

Hey all  :Smile: 

After a few years I decided to put Gentoo again on a new laptop I got and setting up the thing has been going rather remarkably well!

However, I'm now reaching somewhat of a partypooper: When I enter suspend-to-ram (either by closing the lid or by pressing the button in the menu), the machine correctly goes to suspension. However, starting it up again results simply in a black screen. I cannot switch virtual terminal or else I'd just kill the X session and/or read some logs. No, I have to hard-restart with the power button to get anywhere.

I have a KDE 4.8.3 installation and the hardware is a Dell Studio 1555 with 4GB of ram memory.

Some more system info:

```
# emerge --info

Portage 2.1.10.49 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoo x86_64)

=================================================================

System uname: Linux-3.2.12-gentoo-x86_64-Pentium-R-_Dual-Core_CPU_T4300_@_2.10GHz-with-gentoo-2.1

Timestamp of tree: Tue, 22 May 2012 20:45:01 +0000

ccache version 3.1.6 [disabled]

app-shells/bash:          4.2_p20

dev-lang/python:          2.7.3-r1, 3.2.3

dev-util/ccache:          3.1.6

dev-util/cmake:           2.8.7-r5

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.1-r1

sys-apps/openrc:          0.9.8.4

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.68

sys-devel/automake:       1.11.1

sys-devel/binutils:       2.21.1-r1

sys-devel/gcc:            4.5.3-r2

sys-devel/gcc-config:     1.5-r2

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r1

sys-kernel/linux-headers: 3.1 (virtual/os-headers)

sys-libs/glibc:           2.14.1-r3

Repositories: gentoo

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="rsync://mirror.leaseweb.com/gentoo/ http://mirror.leaseweb.com/gentoo/ ftp://mirror.leaseweb.com/gentoo/ rsync://gentoo.tiscali.nl/gentoo/ ftp://gentoo.tiscali.nl/pub/mirror/gentoo/ http://gentoo.tiscali.nl/ ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo rsync://ftp.snt.utwente.nl/gentoo"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"

USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dhcpcd dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glib gpm gtk iconv icu ipv6 jpeg kde kipi lcms ldap libkms libnotify mad minizip mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pppd qt-static qt3support qt4 readline resolvconf sdl semantic-desktop session sip spell sqlite sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wav wxwidgets x264 xcb xcomposite xinerama xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

```

```
# uname -r

3.2.12-gentoo
```

The kernel is a slightly edited genkernel and no proprietary drivers are used (besides the broadcom firmware, but not sure that is relevant).Last edited by Q-collective on Fri Jun 15, 2012 4:46 pm; edited 1 time in total

----------

## eccerr0r

I have a much older Dell Inspiron 600M that I recently figured out how to get it to resume from suspend properly after seeing some other people with the same problem.  After updating BIOS to latest, it turns out the problem with my particular laptop is that the BIOS doesn't initialize enough of the video adaptor for Linux to take over and complete the resume.  The workaround was to add a BIOS password, forcing the machine to initialize video to display the password prompt.

Not sure if this is the same problem but it made my problem go away...

My Asus eeePC and HP Pavillion laptops do not have this issue and resume just fine with no workarounds.  Even some of my desktops resume from S3 sleep where my Inspiron does not...

----------

## ultraincognito

Newly I've found out it is able to turn off and turn on a monitor by the commands:

```
# vbetool dpms off

# vbetool dpms on
```

And I'm thinking, maybe... is it possible to "resurrect" your monitor after a suspend with the last command?

I cannot check it because my suspend to ram works perfectly. The Gentoo is a single distro for me where a suspend to ram works normal with proprietary nvidia drivers.

----------

## Q-collective

 *ultraincognito wrote:*   

> Newly I've found out it is able to turn off and turn on a monitor by the commands:
> 
> ```
> # vbetool dpms off
> 
> ...

 

Silly question maybe, but how do I enter such a command if the screen is blank?

----------

## ultraincognito

After the suspend to ram the some script executes. Find it and add the needed.

----------

## eccerr0r

Also see if your ethernet is still up, you might be able to ssh into it an execute the commands as a quick check to see if the machine's actually up versus frozen...

Or as a silly test do this:

open up a terminal

make a script that sleeps for 60 seconds and then runs the commands.  Run the command.

Then quickly suspend the machine.

Theoretically upon resume, the machine will "resume" the sleep and then finish the script along with the commands...

I should try it on my Dell too to see if it's recoverable by this...maybe this will make me not need an additional password upon resume...

----------

## Q-collective

 *ultraincognito wrote:*   

> After the suspend to ram the some script executes. Find it and add the needed.

 

Not sure what you mean by this. Could you rephrase it?

 *eccerr0r wrote:*   

> Also see if your ethernet is still up, you might be able to ssh into it an execute the commands as a quick check to see if the machine's actually up versus frozen...
> 
> Or as a silly test do this:
> 
> open up a terminal
> ...

 

I tried both approaches and while the little script doesn' t put anything conclusive as to the cause, when I tried logging in via ssh, I couldn't.

So, I think we can conclude here that the system just crashes as opposed to just X?

----------

## Q-collective

 *eccerr0r wrote:*   

> I have a much older Dell Inspiron 600M that I recently figured out how to get it to resume from suspend properly after seeing some other people with the same problem.  After updating BIOS to latest, it turns out the problem with my particular laptop is that the BIOS doesn't initialize enough of the video adaptor for Linux to take over and complete the resume.  The workaround was to add a BIOS password, forcing the machine to initialize video to display the password prompt.
> 
> Not sure if this is the same problem but it made my problem go away...
> 
> My Asus eeePC and HP Pavillion laptops do not have this issue and resume just fine with no workarounds.  Even some of my desktops resume from S3 sleep where my Inspiron does not...

 

I switched on the "Password on Boot" option in BIOS, but this doesn't work as a workaround for the issue. The monitor remains black. This adds to the conclusion that the system has crashed.

----------

## Q-collective

Does anyone have further suggestions?

----------

## Q-collective

I'm still having this issue. Does anyone have further ideas?

----------

## Logicien

Try to suspend to Ram with a minimal active hardware setup. Close your X session and stop Xorg. Put down your network cards, rmmod their drivers, disconnect any non critical devices and try to suspend to Ram. If it restore properly, than you can add one by devices and drivers to find which setup freeze when suspending to Ram.

For more informations, read the files in /usr/src/linux/Documentation/power/ .

----------

## Q-collective

Ok, this is now solved. Installing the fglrx drivers resolved the issue. Those ATI drivers made a real improvement over the last few years to beat the open source ones in issues like these! I remember how getting suspend to work with the fglrx drivers was long considered "hopeless".

Kudos to ATI/AMD.

----------

## Etal

Considering that nowadays AMD is paying people to work on the open-source drivers, have you considered filing a bug report?

----------

## Q-collective

 *Etal wrote:*   

> Considering that nowadays AMD is paying people to work on the open-source drivers, have you considered filing a bug report?

 

Fair point. I'll probably write something up.

----------

