hybernation problem

Hello,

My computer does not hybernate. Suspend to memory works, but hybernate does not.
I suspect the problem to be “not writing a image to the swap”, but i am out of
option in trying to debug this.

After a hybernate command, the computer just reboots. Nothing is remembered.

I tried options in thttps://www.kernel.org/doc/Documentation/power/basic-pm-debugging.txt but got no further.

echo freezer > /sys/power/pm_test

echo platform > /sys/power/disk

echo disk > /sys/power/state

Works!

echo devices > /sys/power/pm_test

echo platform > /sys/power/disk

echo disk > /sys/power/state

Leads to a reboot after a 5 seconds pause.
This might indicate a failing driver, but suspend is working fine. So i thought : this can’t be a driver problem. Now i am stuck.

Below are the outputs of the logfiles.
Hopefully someone can point me in the right direction.

Output of after a hybernate command (like pm-hybernate), the log file pm-suspend-log indicates everything worked:

cat /var/log/pm-suspend.log

Initial commandline parameters:
Sat Nov 7 21:50:28 CET 2015: Running hooks for hibernate.
Running hook /usr/lib/pm-utils/sleep.d/00logging hibernate hibernate:
hibernate initiated: Sat Nov 7 21:50:28 CET 2015

Linux linux-19b9 3.16.7-29-desktop #1 SMP PREEMPT Fri Oct 23 00:46:04 UTC 2015 (6be6a97) x86_64 x86_64 x86_64 GNU/Linux
kernel command line: ‘BOOT_IMAGE=/boot/vmlinuz-3.16.7-29-desktop root=UUID=eb36ed8f-9a32-402f-98df-ffb9b41e5fc9 resume=/dev/disk/by-uuid/14e3858d-bdfa-4fbf-a0ee-84fe039d133e splash=silent quiet showopts’
Module Size Used by
xt_pkttype 12504 4
xt_LOG 17718 14
xt_limit 12711 14
af_packet 40034 0
iscsi_ibft 12862 0
iscsi_boot_sysfs 16000 1 iscsi_ibft
ip6t_REJECT 12939 3
xt_tcpudp 12884 11
nf_conntrack_ipv6 14798 3
nf_defrag_ipv6 34768 1 nf_conntrack_ipv6
ip6table_raw 12683 1
ipt_REJECT 12541 3
iptable_raw 12678 1
xt_CT 12956 4
iptable_filter 12810 1
ip6table_mangle 12700 0
nf_conntrack_netbios_ns 12665 0
nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns
nf_conntrack_ipv4 14806 3
nf_defrag_ipv4 12758 1 nf_conntrack_ipv4
ip_tables 27240 2 iptable_filter,iptable_raw
xt_conntrack 12760 6
nf_conntrack 114273 6 xt_CT,nf_conntrack_netbios_ns,xt_conntrack,nf_conntrack_broadcast,nf_conntrack_ipv4,nf_conntrack_ipv6
ip6table_filter 12815 1
ip6_tables 27026 3 ip6table_filter,ip6table_mangle,ip6table_raw
x_tables 34059 15 xt_pkttype,ip6table_filter,xt_CT,ip6table_mangle,ip_tables,xt_tcpudp,xt_limit,xt_conntrack,xt_LOG,iptable_filter,ip6table_raw,ipt_REJECT,ip6_tables,iptable_raw,ip6t_REJECT
fuse 100461 5
snd_hda_codec_realtek 78935 1
r8169 75790 0
mii 13934 1 r8169
snd_hda_codec_generic 77203 1 snd_hda_codec_realtek
snd_hda_codec_hdmi 55740 1
shpchp 32951 0
snd_hda_intel 34475 8
wmi 19193 0
snd_hda_controller 35103 1 snd_hda_intel
snd_hda_codec 156066 5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
snd_hwdep 13602 1 snd_hda_codec
snd_pcm 116857 4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
sp5100_tco 13999 0
snd_timer 33609 1 snd_pcm
kvm_amd 64385 0
snd 87947 24 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
pcspkr 12718 0
serio_raw 13434 0
kvm 501446 1 kvm_amd
edac_core 66387 0
soundcore 15047 2 snd,snd_hda_codec
i2c_piix4 22166 0
edac_mce_amd 22578 0
k10temp 13144 0
ecryptfs 104008 0
button 13971 0
processor 40484 0
cbc 12774 0
sha256_generic 17081 2
encrypted_keys 18728 1 ecryptfs
dm_mod 111114 0
btrfs 1011342 1
xor 21411 1 btrfs
raid6_pq 106004 1 btrfs
sr_mod 22416 0
cdrom 60734 1 sr_mod
firewire_ohci 44598 0
firewire_core 72767 1 firewire_ohci
crc_itu_t 12707 1 firewire_core
pata_atiixp 13279 0
ohci_pci 13570 0
xhci_hcd 178893 0
pata_jmicron 12775 0
radeon 1502833 3
i2c_algo_bit 13413 1 radeon
drm_kms_helper 65670 1 radeon
ttm 93506 1 radeon
drm 335594 6 ttm,drm_kms_helper,radeon
ata_generic 12923 0
sg 40630 0
trusted 17668 1 encrypted_keys
tpm 39966 1 trusted

         total       used       free     shared    buffers     cached

Mem: 4052844 2207512 1845332 18168 29012 1031608
-/+ buffers/cache: 1146892 2905952
Swap: 6289440 0 6289440

/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/02rtcwake hibernate hibernate:
rtcwake alarm not enabled in /etc/pm/config.d/rtcwake.config, doing nothing…

/usr/lib/pm-utils/sleep.d/02rtcwake hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/06autofs hibernate hibernate:
autofs.service - Automounts filesystems on demand
Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled)
Active: active (running) since Sat 2015-11-07 21:49:17 CET; 1min 10s ago
Docs: man:automount(8)
man:autofs(5)
Process: 3564 ExecStart=/usr/sbin/automount ${AUTOFS_OPTIONS} -p /var/run/automount.pid (code=exited, status=0/SUCCESS)
Main PID: 3612 (automount)
CGroup: /system.slice/autofs.service
└─3612 /usr/sbin/automount -p /var/run/automount.pid

Nov 07 21:49:17 linux-19b9 automount[3612]: lookup_init:139: lookup(yp): map auto.master: Local domain name not set

/usr/lib/pm-utils/sleep.d/06autofs hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate:
INFO: checking for suspend-to-disk prerequisites…
using kernel suspend method
setting image size to 1867550515

/usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/45pcmcia hibernate hibernate:

/usr/lib/pm-utils/sleep.d/45pcmcia hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/50rcnetwork hibernate hibernate:

/usr/lib/pm-utils/sleep.d/50rcnetwork 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 /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 /usr/lib/pm-utils/sleep.d/99Zgrub hibernate hibernate:
INFO: running prepare-grub
Skipping grub entry #3, because it has the noresume option
Skipping grub entry #5, because it has the noresume option
Skipping grub entry #7, because its root= parameter (/dev/disk/by-id/ata-WDC_WD6400AAKS-65A7B2_WD-WCASY9421961-part3)
does not match the current root device (/dev/sdb1).
Skipping grub entry #8, because its root= parameter (/dev/disk/by-id/ata-WDC_WD6400AAKS-65A7B2_WD-WCASY9421961-part3)
does not match the current root device (/dev/sdb1).
Skipping grub entry #9, because it has the noresume option
running kernel is grub menu entry 1 (vmlinuz-3.16.7-29-desktop)
preparing boot-loader: selecting entry 1, kernel /boot/3.16.7-29-desktop
grub-once: saving original /boot/grub2/grubenv
running ‘/usr/sbin/grub2-once 1’
time needed for sync: 0.0 seconds, time needed for grub: 0.0 seconds.

/usr/lib/pm-utils/sleep.d/99Zgrub hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/99info hibernate hibernate:

/usr/lib/pm-utils/sleep.d/99info hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:

/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.
Sat Nov 7 21:50:28 CET 2015: performing hibernate

The kernel log after the hybernate, should have read the image from the swap-partition, but did not:

dmesg | grep “PM:”

0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
0.000000] PM: Registered nosave memory: [mem 0xcfee0000-0xcfee2fff]
0.000000] PM: Registered nosave memory: [mem 0xcfee3000-0xcfeeffff]
0.000000] PM: Registered nosave memory: [mem 0xcfef0000-0xcfefffff]
0.000000] PM: Registered nosave memory: [mem 0xcff00000-0xdfffffff]
0.000000] PM: Registered nosave memory: [mem 0xe0000000-0xefffffff]
0.000000] PM: Registered nosave memory: [mem 0xf0000000-0xfebfffff]
0.000000] PM: Registered nosave memory: [mem 0xfec00000-0xffffffff]
0.000000] PM: Registered nosave memory: [mem 0xc4000000-0xc7ffffff]
0.204032] PM: Registering ACPI NVS region [mem 0xcfee0000-0xcfee2fff] (12288 bytes)
1.359357] PM: Checking hibernation image partition /dev/disk/by-uuid/14e3858d-bdfa-4fbf-a0ee-84fe039d133e
2.545122] PM: Hibernation image not present or could not be loaded.
4.233166] PM: Marking nosave pages: [mem 0x0009f000-0x000fffff]
4.233170] PM: Marking nosave pages: [mem 0xcfee0000-0xffffffff]
4.233557] PM: Marking nosave pages: [mem 0xc4000000-0xc7ffffff]
4.233709] PM: Basic memory bitmaps created
4.242506] PM: Basic memory bitmaps freed
4.244227] PM: Starting manual resume from disk
4.244230] PM: Hibernation image partition 8:2 present
4.244231] PM: Looking for hibernation image.
4.244697] PM: Image not found (code -22)
4.244698] PM: Hibernation image not present or could not be loaded.

Check to see if the right swap partition is used:

blkid | grep “swap”

/dev/sda2: UUID=“14e3858d-bdfa-4fbf-a0ee-84fe039d133e” TYPE=“swap” PARTUUID=“000acf3a-02”

dmesg | grep “14e3858d-bdfa-4fbf-a0ee-84fe039d133e”

0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.16.7-29-desktop root=UUID=eb36ed8f-9a32-402f-98df-ffb9b41e5fc9 resume=/dev/disk/by-uuid/14e3858d-bdfa-4fbf-a0ee-84fe039d133e splash=silent quiet showopts
0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16.7-29-desktop root=UUID=eb36ed8f-9a32-402f-98df-ffb9b41e5fc9 resume=/dev/disk/by-uuid/14e3858d-bdfa-4fbf-a0ee-84fe039d133e splash=silent quiet showopts
1.359357] PM: Checking hibernation image partition /dev/disk/by-uuid/14e3858d-bdfa-4fbf-a0ee-84fe039d133e

Try to uninstall suspend and/or pm-utils.

Thanks for the suggestion!

I uninstalled both.

However, the result is the same. After hybernation there is a reboot. The dmesg is the same. The only difference is that the pm-suspend.log file is now gone.

This log is unrelated to your tests; it is not created by kernel.

So what you could try is

  • test “shutdown” hibernation method. Although if it fails with “devices” already, it probably won’t change anything.
  • boot into run level 1; test hibernation there. If it does not work, start unloading modules one by one, testing each time. When you found one that breaks hibernation, open bug report.
  • if you cannot hibernate even in run level 1, try with init=/bin/sh (that will completely skip loading of all extra modules not part of initrd).
  • if nothing works, you would need to capture kernel log during hibernation somehow. Do you have serial port in your system and second PC? Without serial port netconsole may work.

Thanks.

I first tried the " fail safe" mode. Then hibernation works using the following commands:

echo platform > /sys/power/disk

echo disk > /sys/power/state

It must be a module (not loaded in fail safe mode) causing the problem when running normally.
I will now try to work my way trough all modules, to find out which one it is.
This may take a while…

Fail safe menu entry also adds some kernel options; you may try them individually. Otherwise first suspect is video drivers.

I have a radeon card with a radeon module loaded. I suspect this one to be the problem.

I tested with:
After normal boot:

lsmod | sort > modules-no-hibernation.txt

After boot in failsafe mode:

lsmod | sort > modules-and-hibernation.txt

diff -y modules-and-hibernation.txt modules-no-hibernation.txt | less

The only difference is the radeon module which is not present in the “modules-and-hibernation.txt” list.

Testing is if it is the module is difficult. After a normal boot:

modprobe -r radeon

modprobe: FATAL: Module radeon is in use.

I also tried via blacklist

emacs /etc/modprobe.d/50-blacklist.conf

added the following lines three lines
*#

Blacklist the radeon for testing hibernation

blacklist radeon*

But that does not prevent the radeon module to load.

i found some other options:

I will try those later.

If it is the radeon module, i can also use the binary of AMD Catalyst or upgrade to a new (kernel) version with improved radeon module (like in the openSUSE Leap 42.1 with a newer kernel).

The module is loaded by the initrd already before / is mounted.
So you have to run “mkinitrd” after creating the blacklist to add the blacklist to the initrd.

Adding “nomodeset” (or “radeon.modeset=0”) to kernel options should prevent it from being loaded too.

I was just looking at SDB:AMD fglrx - openSUSE Wiki. This stated the same.
I was there because i wanted to install the fglrx driver and use that instead of the radeon driver.

This worked!

Hibernation is now working in normal mode, using the AMD fglrx driver. It must have been the radeon driver causing the trouble.

Thanks for all the help. It was a driver after all. Solved!

Do you want to fill in a bug-report? The kernel 3.16 used in opensue 13.2 is older than the current version and the radeon code is changed in the current version.
If i fill in a bug-report it will be for an outdated driver, but that might still be usefull.

13.2 is still supported for quite some time and this is obvious bug, so yes, I would file bug report.

Bug reported:
Bugzilla – Bug 954155