tracking down suspend/hibernate bugs?

Matt Price matt.price at utoronto.ca
Mon Jan 14 18:30:33 UTC 2008


On Mon, 2008-01-14 at 15:23 +0000, Matthew Garrett wrote:
> On Sun, Jan 13, 2008 at 10:51:48PM -0800, Matt Price wrote:
> 
> > in hardy it appears that acpi-support has been cut out entirely in favor
> > of pm-utils -- see the attached hal-system-power-suspend-linux script.
> > i've flipped through the pm-utils code & can't see exactly how it's
> > determined what is used to make the actual suspend call -- for instance,
> > i'm not sure what I would do if i wanted to use a custom kernel with
> > tuxonice for suspend, which i think still works best if it's called by
> > the hibernate script.  
> 
> If it's triggered by writing disk to /sys/power/state (which I believe 
> it is, nowadays) then pm-hibernate will trigger it happily. Please don't 
> use the hibernate script - any cases where it works and pm-utils doesn't 
> are bugs that need fixing.
> 
ok, i won't use it, but it appears that i have one of those cases -- see
below.  i'm still missing some of the flexibility & the extensive
logging capabilities of hibernate.  my /var/log/pm-suspend is very brief
-- right now it reads:

> Sun Jan 13 18:04:49 PST 2008: running hibernate hooks.
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/00clear =====
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/05led =====
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/10NetworkManager =====
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/20video =====
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/49bluetooth =====
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/50modules =====
> ===== Sun Jan 13 18:04:49 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/90clock =====
> ===== Sun Jan 13 18:04:50 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/94cpufreq =====
> ===== Sun Jan 13 18:04:50 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/95led =====
> ===== Sun Jan 13 18:04:50 PST 2008: running hook: /usr/lib/pm-utils/sleep.d/99video =====
> Sun Jan 13 18:04:50 PST 2008: done running hibernate hooks.

... i suppose if the resume worked properly the reverse steps would be present too?  

> > i alsoseem to have an odd problem -- if i choose 'suspend' from the
> > gnome 'quit' menu, then resume fails.  if, however, i suspend just by
> > closing the lid on my laptop, suspend and resume both succeed.  this
> > suggests to me that two different methods are being used, probably acpi
> > in the lid case and pm-utils in the gnome case.  seems to me this
> > shouldn't happen; again, i'm not quite sure what's going on.  
> 
> Both cases should be the same. I'll check to make sure that the logout 
> dialog is triggering pm-utils, but lid closure should certainly be going 
> through hal.
> 
ah, this is my bad -- it seems an old script i had in
in /etc/acpi/lid-hibernate.sh was being called on lid closure; i thought
i'd verified that my old scripts had been replaced by the standard ones
on upgrade, but that one escaped my attention.  that script calls
hibernate, which suspends & resumes successfully, while pm-utils appears
not to.  

now the question is, what i should do to track down what is causing one
process to work while the other fails.  attached are my acpi lid
hibernate script, and the various config files called in succession by
the hibernate program.  evolution doesn't seem to be letting me rename
them, so i'll say that common.conf-mine is symlinked
to /etc/hibernate/common.conf, which is eventually loaded by either
sysfs-disk.conf or ususpend-ram.conf -- i'm not sure which method is
actually executed at the moment.  hibernate-short is my hibernate log
from a single syspend-resume cycle.  pls let me know whether this stuff
helps.  i'm hoping that i can set the value of $QUIRKS to match what's
happening in hibernate & make pm-utils work just as well; but right now
i'm not sure how to do that.

> > apt cache gives this list as the ubuntu maintainer of pm-utils; the
> > changelog suggests that the package has just been ported over unchanged
> > from debian.  if it's going to be the main power management tool, it
> > seems like an important piece of infrastructure; is anyone at ubuntu
> > watching over it at all?  if so, please let me know what i can do to
> > help with debugging and stuff.  
> 
> Yes, I'm looking after it.
well, thanks for that & for responding so quickly.

matt

> -- 
> Matthew Garrett | mjg59 at srcf.ucam.org
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lid-hibernate.sh
Type: application/x-shellscript
Size: 206 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20080114/2326eabf/attachment.bin>
-------------- next part --------------
# This file is used when suspending to RAM. Use the *-ram.conf files to add
# configuration options, or add them before the TryMethod lines in this file.
# Options are not case-sensitive.
# 
# See hibernate.conf(5) for help on the configuration items.

# save to both, RAM and disk
# (disabled by default, since it takes longer)
# TryMethod ususpend-both.conf

TryMethod ususpend-ram.conf
TryMethod sysfs-ram.conf

# The following vbetool settings help with a number of laptops
# EnableVbetool yes
# VbetoolPost yes

# Users with a Radeon graphics card may need to enable this line for
# suspend-to-ram, and install the radeontool program available from
# http://fdd.com/software/radeon/ or your distribution's package.
# 
# RadeonTool yes

# The following is needed for most old BIOS laptops
# AcpiVideoS3Bios yes
# AcpiVideoS3Mode yes
-------------- next part --------------
# Configuration options common for suspending to disk or RAM.
# Options are not case sensitive.
# 
# See hibernate.conf(5) for help on the configuration items.

##############################################################################
### Some global settings
##############################################################################

Verbosity 2
LogFile /home/matt/hibernate.log
LogVerbosity 2
# LogTimestamp yes
# AlwaysForce yes
# AlwaysKill yes
# HibernateVT 15
Distribution debian
# 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 /var/backups/grub.conf.hibernate
#
## see http://bugs.debian.org/317479
# RemountXFSBoot yes
#RemountXFSBoot no

### hardware_tweaks
# IbmAcpi yes
# Runi915resolution 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 "Good night!"
OnResume 20 echo "Good morning!"

### modules
# UnloadModules snd_via82cxxx usb-ohci
# UnloadAllModules yes
# trying to fix the sound modules
# try to remove them one at a time from this list
# UnloadModules snd_hda_intel  snd_hda_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd
UnloadBlacklistedModules yes
UnloadModules  ehci_hcd uhci_hcd hci_usb  
LoadModules auto
# LoadModulesFromFile /etc/modules

### modules-gentoo
# GentooModulesAutoload yes

### network
# DownInterfaces eth0
# UpInterfaces auto

### pause_audio
# PauseAudio yes

### pcmcia
# EjectCards yes

### programs
# IncompatiblePrograms xmms

### services
# RestartServices laptop-mode
# StopServices alsasound
# StartServices aumix

### vbetool
# EnableVbetool yes
# RestoreVbeStateFrom /var/lib/vbetool/vbestate
# VbetoolPost yes
# RestoreVCSAData yes
#  I think these all need to be disabled for nvidia to work
EnableVbetool no
VbetoolPost no
RestoreVCSAData no


### xhacks
SwitchToTextMode yes
# SwitchToTextMode no
# UseDummyXServer yes
# DummyXServerConfig xorg-dummy.conf

### xstatus
## This can be set to gnome, kde or x:
# XStatus gnome
# XmessageDisable yes
# 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

-------------- next part --------------
# This file is used when suspending to RAM using the uswsusp functionality in
# the kernel. You will require the s2disk binary to be installed - this can be
# downloaded from http://suspend.sourceforge.net/ . On Debian systems, just
# install the uswsusp package.
# Add any configuration options specific to ususpend to this file. Ordering is
# not crucial, and options are not case-sensitive.
# 
# See hibernate.conf(5) for help on the configuration items.

USuspendMethod ram

## if needed, pass the -f option to s2ram
# USuspendRamForce yes

## if s2ram is unsure, let it use system-specific options instead of having to
## force it.
# USuspendRamUnsureOk yes

## if needed, pass the -m option to s2ram
## (-m should be used instead of -s, if possible; see
## https://bugzilla.novell.com/show_bug.cgi?id=229603)
# USuspendRamVbeMode yes

## if needed, pass the -s option to s2ram
## (if possible, prefer -m to -s; see above)
# USuspendRamVbeSave yes

## if needed, pass the -p option to s2ram
# USuspendRamVbePost yes

## if needed, pass the -a option to s2ram
## (Intel users see: http://en.opensuse.org/S2ram#Intel_Graphics_Chipsets)
# USuspendRamAcpiSleep 3

Include common.conf
-------------- next part --------------
Starting suspend at Mon Jan 14 06:33:38 PST 2008
hibernate: [01] Executing CheckLastResume ...
hibernate: [01] Executing CheckRunlevel ...
hibernate: [01] Executing LockFileGet ...
hibernate: [01] Executing NewKernelFileCheck ...
hibernate: [10] Executing EnsureSysfsPowerStateCapable ...
hibernate: [11] Executing XHacksSuspendHook1 ...
hibernate: [20] Executing MiscLaunchAuxFunc1 ...
Executing echo "Good night!"...
Good night!
hibernate: [20] Executing MiscLaunchAuxFunc3 ...
Executing echo "Good night!"...
Good night!
hibernate: [59] Executing RemountXFSBootRO ...
hibernate: [89] Executing SaveKernelModprobe ...
hibernate: [90] Executing ModulesUnload ...
Unloading module ehci_hcd...
Unloading module uhci_hcd...
Unloading module hci_usb...
Unloading module ehci_hcd...not loaded.
Unloading module uhci_hcd...not loaded.
Unloading module hci_usb...not loaded.
hibernate: [91] Executing ModulesUnloadBlacklist ...
Unloading blacklisted modules listed /etc/hibernate/blacklisted-modules
Unloading blacklisted module iwl3945 (and dependencies)
Unloading blacklisted module mac80211 (and dependencies)
hibernate: [91] Executing ModulesUnloadBlacklist ...
Unloading blacklisted modules listed /etc/hibernate/blacklisted-modules
hibernate: [95] Executing XHacksSuspendHook2 ...
hibernate: [98] Executing CheckRunlevel ...
hibernate: [99] Executing DoSysfsPowerStateSuspend ...
hibernate: Activating sysfs power state mem ...
hibernate: [90] Executing ModulesLoad ...
Loading module ehci_hcd (from auto)...
Loading module uhci_hcd (from auto)...
Loading module hci_usb (from auto)...
Loading module iwl3945 (from auto)...
Loading module mac80211 (from auto)...
Loading module ehci_hcd (from auto)...
Loading module uhci_hcd (from auto)...
Loading module hci_usb (from auto)...
Loading module iwl3945 (from auto)...
Loading module mac80211 (from auto)...
hibernate: [89] Executing RestoreKernelModprobe ...
hibernate: [85] Executing XHacksResumeHook2 ...
hibernate: [70] Executing ClockRestore ...
hibernate: [70] Executing ClockRestore ...
hibernate: [59] Executing RemountXFSBootRW ...
hibernate: [20] Executing MiscLaunchAuxFunc4 ...
Executing echo "Good morning!"...
Good morning!
hibernate: [20] Executing MiscLaunchAuxFunc2 ...
Executing echo "Good morning!"...
Good morning!
hibernate: [11] Executing XHacksResumeHook1 ...
hibernate: [01] Executing NoteLastResume ...
hibernate: [01] Executing LockFilePut ...
Resumed at Mon Jan 14 06:57:10 PST 2008
-------------- next part --------------
# This file is used when suspending to RAM. Add any configuration options
# specific to suspend-to-RAM to this file. Ordering is not crucial, and options
# are not case-sensitive.
# 
# See hibernate.conf(5) for help on the configuration items.

UseSysfsPowerState mem

Include common.conf


More information about the Ubuntu-devel-discuss mailing list