During a recent upgrade (I forget the exact date when this started happening, but I've been trying to fix it on my own for a few months now) I began to have problems hibernating my laptop (a System76 Starling s4 netbook). I use LVM on top of a partition encrypted with DM-Crypt (thus my swap partition is encrypted after shutdown), which is an unusual configuration but up until now hasn't given me any problems.
When hibernating, everything SEEMS to work - the laptop shutdowns properly, and no obvious errors show up in /var/log/everything.log or /var/log/pm-suspend.log. After rebooting, everything looks good until the kernel finishes loading the hibernated image into RAM, at which point the system spontaneously reboots itself, and then loads as if there is no hibernate image to resume from. No messages are recorded in any logs until after the spontaneous reboot, however.
The only thing I've found is an indication that some systems may need to append the acpi_sleep=nonvs option to their kernel line in order to resume properly due to recent changes in how hibernation is handled. I've also tried switching between the kernel's built-in hibernation code, and the uswsusp backend. None of these has changed the resume behavior in the least (though uswsusp is a lot faster!).
Here's some relevant code:
snapshot device = /dev/snapshot resume device = /dev/mapper/critter-swap image size = 0 #suspend loglevel = 2 #compute checksum = y compress = y #encrypt = y early writeout = y splash = n shutdown method = platform threads = y
# (0) Arch Linux title Arch Linux root (hd0,0) kernel /vmlinuz26 root=/dev/mapper/critter-root cryptdevice=/dev/sda:crypto resume=/dev/mapper/critter-swap acpi_sleep=nonvs ro initrd /kernel26.img
/etc/pm/config.d/overrides (just the default tweaked for uswsusp):
# Default method to power down the system when hibernating. # If commented out, the system will use the kernel default as a # default value. # # Check /sys/power/disk for valid values. The default value # will be surrounded by [square brackets]. # HIBERNATE_MODE="shutdown" # Whether we need to post the video card when resuming from # hibernate. You should not normally need to set this. # In the future pm-utils will get this setting from HAL. # # Valid values are "no" and "yes" # HIBERNATE_RESUME_POST_VIDEO="no" # The default sleep/wake system to use. Valid values are: # kernel The built-in kernel suspend/resume support. # Use this if nothing else is supported on your system. # uswsusp If your system has support for the userspace # suspend programs (s2ram/s2disk/s2both), then use this. # tuxonice If your system has support for tuxonice, use this. # # The system defaults to "kernel" if this is commented out. SLEEP_MODULE="uswsusp" # These variables will be handled specially when we load files in # /etc/pm/config.d. # Multiple declarations of these environment variables will result in # their contents being concatenated instead of being overwritten. # If you need to unload any modules to suspend/resume, add them here. # SUSPEND_MODULES="" # If you want to keep hooks from running, add their names here. # HOOK_BLACKLIST="" # If you want to unconditionally add parameters to the commandline, # add them here. # ADD_PARAMETERS="" # If you want to ignore commandline parameters, add them here. # DROP_PARAMETERS="" # If you need to synchronize the system clock across a suspend/resume or # hibernate/thaw cycle, set this variable. # NEED_CLOCK_SYNC="true"
# vim:set ft=sh # MODULES # The following modules are loaded before any boot hooks are # run. Advanced users may wish to specify all system modules # in this array. For instance: # MODULES="piix ide_disk reiserfs" MODULES="acpi-cpufreq cpufreq_ondemand i915" # BINARIES # This setting includes any additional binaries a given user may # wish into the CPIO image. This is run first, so it may be used to # override the actual binaries used in a given hook. # (Existing files are NOT overwritten if already added) # BINARIES are dependency parsed, so you may safely ignore libraries BINARIES="" # FILES # This setting is similar to BINARIES above, however, files are added # as-is and are not parsed in any way. This is useful for config files. # Some users may wish to include modprobe.conf for custom module options # like so: # FILES="/etc/modprobe.d/modprobe.conf" FILES="/etc/modprobe.d/modprobe.conf /etc/suspend.conf /usr/share/kbd/consolefonts/ter-114n.psf.gz" # HOOKS # This is the most important setting in this file. The HOOKS control the # modules and scripts added to the image, and what happens at boot time. # Order is important, and it is recommended that you do not change the # order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for # help on a given hook. # 'base' is _required_ unless you know precisely what you are doing. # 'udev' is _required_ in order to automatically load modules # 'filesystems' is _required_ unless you specify your fs modules in MODULES # Examples: ## This setup specifies all modules in the MODULES setting above. ## No raid, lvm2, or encrypted root is needed. # HOOKS="base" # ## This setup will autodetect all modules for your system and should ## work as a sane default # HOOKS="base udev autodetect pata scsi sata filesystems" # ## This is identical to the above, except the old ide subsystem is ## used for IDE devices instead of the new pata subsystem. # HOOKS="base udev autodetect ide scsi sata filesystems" # ## This setup will generate a 'full' image which supports most systems. ## No autodetection is done. # HOOKS="base udev pata scsi sata usb filesystems" # ## This setup assembles a pata mdadm array with an encrypted root FS. ## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. # HOOKS="base udev pata mdadm encrypt filesystems" # ## This setup loads an lvm2 volume group on a usb device. # HOOKS="base udev usb lvm2 filesystems" HOOKS="base consolefont udev autodetect sata usbinput encrypt lvm2 uresume filesystems" # COMPRESSION # Use this to compress the initramfs image. With kernels earlier than # 2.6.30, only gzip is supported, which is also the default. Newer kernels # support gzip, bzip2 and lzma. Kernels 2.6.38 and later support xz # compression. #COMPRESSION="gzip" #COMPRESSION="bzip2" #COMPRESSION="lzma" COMPRESSION="xz" #COMPRESSION="lzop" # COMPRESSION_OPTIONS # Additional options for the compressor #COMPRESSION_OPTIONS=""
Latest operation from /var/log/pm-suspend.log:
Initial commandline parameters: Fri Jul 22 19:14:06 MDT 2011: Running hooks for hibernate. Running hook /usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: Linux critter 2.6.39-ARCH #1 SMP PREEMPT Sat Jul 9 15:31:04 CEST 2011 i686 Intel(R) Atom(TM) CPU N550 @ 1.50GHz GenuineIntel GNU/Linux Module Size Used by uinput 5864 2 ipv6 249068 16 ext2 55475 0 usb_storage 35215 0 uas 6480 0 snd_hda_codec_realtek 225687 1 snd_hda_intel 19261 0 snd_hda_codec 66665 2 snd_hda_codec_realtek,snd_hda_intel snd_hwdep 4919 1 snd_hda_codec snd_pcm 60311 2 snd_hda_intel,snd_hda_codec snd_timer 15542 1 snd_pcm sg 21022 0 sdhci_pci 6886 0 snd 43399 6 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer sdhci 15197 1 sdhci_pci soundcore 5018 1 snd iTCO_wdt 10333 0 mmc_core 60838 1 sdhci serio_raw 3430 0 psmouse 55927 0 snd_page_alloc 5909 2 snd_hda_intel,snd_pcm iTCO_vendor_support 1553 1 iTCO_wdt wmi 7367 0 i2c_i801 7039 0 jmb38x_ms 7137 0 battery 8905 0 ac 2545 0 memstick 5494 1 jmb38x_ms thermal 6603 0 evdev 7310 2 fuse 58669 1 ext4 334562 2 mbcache 4321 2 ext2,ext4 jbd2 59098 1 ext4 crc16 1077 1 ext4 cryptd 6901 0 aes_i586 6948 8 aes_generic 25678 1 aes_i586 xts 1969 4 gf128mul 5862 1 xts dm_crypt 13279 1 dm_mod 57126 12 dm_crypt sd_mod 25483 1 ahci 18093 1 uhci_hcd 19312 0 libahci 16581 1 ahci libata 154285 2 ahci,libahci ehci_hcd 34847 0 scsi_mod 110702 5 usb_storage,uas,sg,sd_mod,libata usbcore 119324 5 usb_storage,uas,uhci_hcd,ehci_hcd i915 557838 1 drm_kms_helper 24245 1 i915 drm 147653 2 i915,drm_kms_helper intel_agp 8664 1 i915 i2c_algo_bit 4431 1 i915 button 3654 1 i915 intel_gtt 11417 3 i915,intel_agp agpgart 22160 3 drm,intel_agp,intel_gtt i2c_core 16665 5 i2c_i801,i915,drm_kms_helper,drm,i2c_algo_bit video 9852 1 i915 cpufreq_ondemand 5064 4 acpi_cpufreq 5053 1 freq_table 2055 2 cpufreq_ondemand,acpi_cpufreq processor 21884 1 acpi_cpufreq mperf 1035 1 acpi_cpufreq total used free shared buffers cached Mem: 2055012 335176 1719836 0 9648 133300 -/+ buffers/cache: 192228 1862784 Swap: 4194300 0 4194300 /usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: /usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/01grub hibernate hibernate: /usr/lib/pm-utils/sleep.d/01grub hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/11netcfg hibernate hibernate: /usr/lib/pm-utils/sleep.d/11netcfg hibernate hibernate: success. Running hook /etc/pm/sleep.d/20network hibernate hibernate: /etc/pm/sleep.d/20network hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/49bluetooth hibernate hibernate: /usr/lib/pm-utils/sleep.d/49bluetooth hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: success. Running hook /etc/pm/sleep.d/90alsa hibernate hibernate: /etc/pm/sleep.d/90alsa hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: /usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: /usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/95led hibernate hibernate: /usr/lib/pm-utils/sleep.d/95led hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: Kernel modesetting video driver detected, not using quirks. /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success. Running hook /etc/pm/sleep.d/99power hibernate hibernate: [pm-action] /etc/pm/sleep.d/99power hibernate: NoOp /etc/pm/sleep.d/99power hibernate hibernate: success. Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate: /usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success. Fri Jul 22 19:14:07 MDT 2011: performing hibernate
Contents of /var/log/everything.log from hibernate period:
Jul 22 19:14:06 localhost kernel: [ 357.258734] EXT4-fs (dm-2): re-mounted. Opts: commit=0 Jul 22 19:14:06 localhost kernel: [ 357.465794] EXT4-fs (dm-3): re-mounted. Opts: commit=0 Jul 22 19:14:07 localhost kernel: [ 358.592161] PM: Marking nosave pages: 000000000009d000 - 0000000000100000 Jul 22 19:14:07 localhost kernel: [ 358.592173] PM: Basic memory bitmaps created
Anyone having a similar problem, or have any suggestions what else I could try? I'm completely out of ideas!
The thread skunktrader points to seems to be the same issue, and downgrading to 18.104.22.168-1 works as a temporary fix. Since this is essentially a duplicate thread, it seems best to monitor https://bbs.archlinux.org/viewtopic.php?id=119202 instead for more permanent fixes...
Last edited by naxan (2011-07-25 15:23:22)
For I dipt into the future, far as human eye could see,
Saw the Vision of the world, and all the wonder that would be...
Sounds similar to this
Wow, I don't know how I missed that post. Downgrading to kernel26 22.214.171.124-1 indeed fixes the problem.
That said, EVERY subsequent kernel26 I've tested (every release except for what's in [testing]) seems to break resume from hibernate.
Downgrading is a temporary solution, but I'd love to have a better sense of what might have changed between 126.96.36.199 and 188.8.131.52 to break things...
For I dipt into the future, far as human eye could see,
Saw the Vision of the world, and all the wonder that would be...