# pm-hibernate doesn't resume

## rainbowgoblin

I'm running KDE 4.6 with the gentoo-sources kernel 2.6.37-r4 and pm-utils 1.4.1 on a Sony Vaio SR-590 laptop. I've managed to get pm-suspend to both suspend to RAM and resume (somehow, magically), but pm-hibernate doesn't seem to want to suspend to disk. I've got my swap partition set in both my kernel and my grub.conf file, and when pm-hibernate hibernates, I get a little progress counter that tells me that it's written 100% to disk. My swap partition is also big (6 GB, on a system with 4 GB RAM). 

I've tried both in KDE and with console only, and I get the same result: the system hibernates, but then when I hit the power button, I just boot up normally through grub. Am I supposed to resume in some way other than with the power button?

Here's the output that pm-hibernate writes to /var/log/pm-suspend.log

```

Initial commandline parameters: 

Blacklisting 55NetworkManager.

Blacklisting 90clock.

Thu May 26 17:47:01 NZST 2011: Running hooks for hibernate.

Running hook /usr/lib64/pm-utils/sleep.d/00logging hibernate hibernate:

Linux fujin 2.6.37-gentoo-r4 #1 SMP Tue Apr 19 14:31:20 NZST 2011 x86_64 Intel(R) Core(TM)2 Duo CPU P8800 @ 2.66GHz GenuineIntel GNU/Linux

Module                  Size  Used by

coretemp                4800  0 

sco                     7715  2 

bnep                    9568  2 

rfcomm                 28302  5 

l2cap                  30734  16 bnep,rfcomm

kvm_intel              39931  0 

kvm                   240299  1 kvm_intel

fglrx                2648062  0 

btusb                   9591  2 

bluetooth              44773  9 sco,bnep,rfcomm,l2cap,btusb

sdhci_pci               6623  0 

sdhci                  13501  1 sdhci_pci

mmc_core               52589  1 sdhci

uvcvideo               52328  0 

videodev               54086  1 uvcvideo

v4l1_compat            11566  2 uvcvideo,videodev

v4l2_compat_ioctl32     9371  1 videodev

iwlagn                118712  0 

iwlcore                46704  1 iwlagn

sony_laptop            22348  0 

backlight               3412  1 sony_laptop

             total       used       free     shared    buffers     cached                                                                                                           

Mem:       4027612     228284    3799328          0       9944     124184                                                                                                           

-/+ buffers/cache:      94156    3933456                                                                                                                                            

Swap:     12594956          0   12594956                                                                                                                                            

                                                                                                                                                                                    

/usr/lib64/pm-utils/sleep.d/00logging hibernate hibernate: success.                                                                                                                 

Running hook /usr/lib64/pm-utils/sleep.d/00powersave hibernate hibernate:

Blacklisting 55NetworkManager.

Blacklisting 90clock.

/usr/lib64/pm-utils/sleep.d/00powersave hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/01grub hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/01grub hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/49bluetooth hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/49bluetooth hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/55NetworkManager hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/55NetworkManager hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/75modules hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/75modules hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/90clock hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/90clock hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/94cpufreq hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/95led hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/95led hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:

ATI Catalyst driver detected, not using quirks.

/usr/lib64/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success.

Running hook /usr/lib64/pm-utils/sleep.d/99video hibernate hibernate:

/usr/lib64/pm-utils/sleep.d/99video hibernate hibernate: success.

Thu May 26 17:47:03 NZST 2011: performing hibernate

```

So sad!

----------

## mahdi1234

Can you post your grub config?

----------

## rainbowgoblin

grub.conf:

```

default 0

timeout 10

splashimage=(hd0,1)/grub/blue.xpm.gz

title Gentoo Linux 2.6.37-r4

root (hd0,1)

kernel /boot/kernel-2.6.37-gentoo-r4 root=/dev/sda4 resume=/dev/sda3 ro vga=0x323 video=vesafb:mtrr:3,ywrap

#title Gentoo Linux 2.6.29-r5

#root (hd0,1)

#kernel /boot/kernel-2.6.29-gentoo-r5 root=/dev/sda4 vga=0x323 video=vesafb:mtrr:3,ywrap

#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3

#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5

# vim:ft=conf:

```

On the ArchWiki they talk about adding 'resume' to the hooks array in /etc/mkinitcpio.conf ... this looks to be ArchLinux-specific. Is there anything similar we need to do?

----------

## Hu

If you turn the kernel output level up to debug, what does hibernate.c say about the resume partition?

----------

## rainbowgoblin

Ok, here we go. I'm not sure if I've done exactly what you asked, but I added 'loglevel=7' to my grub.conf kernel line, and looked at dmesg, where I see the following lines:

```

[    1.318224] PM: Checking hibernation image partition /dev/sda3

[    2.118134] PM: Hibernation image partition 8:3 present

[    2.118135] PM: Looking for hibernation image.

[    2.119231] PM: Image not found (code -22)

[    2.119233] PM: Hibernation image not present or could not be loaded.

```

That looks weird to me... the image is present when "checked", but then not found later on.

----------

## Hu

The message says that it found the partition, not that it found the image.  Those messages are not contradictory.  They state that, as far as the kernel can tell, you have a valid place to store the image, but there is no valid hibernation image stored there.

----------

## rainbowgoblin

That's too bad. I wish I understood why.

I originally stated that I had "magically" gotten pm-suspend to resume. Well, I understand how I did that now. I've just compiled a new kernel (2.6.38 ), and it broke pm-suspend (it wouldn't resume afterwards anymore). So I tried pm-suspend from the console, it resumed, I logged into KDE again, and now I can suspend/resume again. 

Sadly, the new kernel still won't hibernate/resume. But hopefully my suspend/resume magic trick will help someone who happens upon this thread.

----------

## Hu

I suspect that the system is powered down without finalizing the hibernation image, though I do not know why that would be.  Can you reproduce the problem with an untainted kernel?

----------

## rainbowgoblin

"Tainted" just means that there are modules loaded that the kernel wasn't really written for, right? Like fglrx? I'm pretty certain that fglrx is the only module like that I have, so just to be sure, here's what I did:

- I blacklisted fglrx by writing a file /etc/modprobe.d/fglrx-blacklist.conf containing the line "blacklist fglrx"

- I eselected the xorg-x11 opengl

- I compiled a new kernel with the Radeon KMS support (I just followed the current Xorg guide for this)

Ultimately, I couldn't get X to start anyway, so I'm not sure how much that all matters. I checked lsmod to make sure fglrx wasn't loaded, then I tried pm-hibernate from the console. Normally after I type pm-hibernate, I get a bunch of information about how it's writing the image to /dev/sda3, then my system powers down. Since I've been using the 2.6.38 kernel, I don't get the information about the image being written, but it still powers down. This time, it didn't even power down. I had about 30 seconds where the screen went black, but nothing else happened. The system wasn't completely frozen, I could still toggle num lock, but I tried to use echo to write some garbage to a file in my home directory, and that didn't work, so it was pretty much down. Then, after about 30 seconds, I got a bunch of noise on the screen, like when you have the wrong video setting or something (like, a bunch of white squiggly nothing). Then the system rebooted on its own.

So not exactly the same symptoms (I've never had a spontaneous reboot, just spontaneous power down), but not good, either.

----------

## rainbowgoblin

OK, I have X working with the open source drivers now, and I still get the same "noise" on the screen when I try to hibernate.

I'm guessing that the kernel is still considered tainted with the radeon-ucode blobs though, right? In any case, hibernate doesn't work.

----------

## Hu

The taint marker can be set for various reasons.  You had the proprietary taint, which indicates you loaded a closed source driver.  Historically, bugs in those drivers have been the explanation for "weird" things, so testing without them is a common first step when a weird failure appears.

 *rainbowgoblin wrote:*   

> I'm guessing that the kernel is still considered tainted with the radeon-ucode blobs though, right? In any case, hibernate doesn't work.

 No, those are uploaded to the graphics card, so they do not count.

Does hibernate fail even if you never start X, but instead hibernate directly from the text console?

----------

## rainbowgoblin

Yeah. Same symptoms exactly.

----------

## rainbowgoblin

Awww, crap. Now pm-suspend won't resume either. It worked yesterday, and I don't think I actually changed anything. I made KDE with the radeon driver work with my HDMI out connector, but that can't be the problem, because pm-suspend won't resume when I stop xdm either. What have I done?

----------

## rainbowgoblin

pm-suspend works again (magic! I didn't change a thing). Still no luck with waking up from pm-hibernate...

----------

