# Resume (Thaw) from hibernate with kernel 3.0.6

## UncleVan

Following behavior after upgrading to 3.0.6 :

To resume succesfully from hibernation (suspend to disk) I had to add "resume=/dev/sda1" to the grub boot line, where /dev/sda1 is actually my swap partition; so the menu looks like:

############

default 0

timeout 30

#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux ( kernel-ivan-x86-3.0.6-gentoo.ivan  )

root (hd0,1)

kernel /boot/kernel root=/dev/ram0 real_root=/dev/sda3 vga=791 resume=/dev/sda1

initrd /boot/initramfs

title Old Gentoo Linux ( System.map-ivan-x86-2.6.39-gentoo-r3.ivan )

root (hd0,1)

kernel /boot/kernel.old root=/dev/ram0 real_root=/dev/sda3 vga=791 # <- no need for resume

initrd /boot/initramfs.old

##############

 Without this kernel 3.0.6 just boots normally without any notion of the hibernated image.

In contrary to the "2.6.39-gentoo-r3", where all this happens "the magical way" with no  intervention in the menu.1st .

System obviosly uses "pm-hibernate" from the "sys-power/pm-utils-1.4.1" package for the job.

My system is Lenovo Thinkpad Edge 11" and the kernel is configured accordingly, if in fact it is able to resume. 

I suspect some missing module in the initramfs, but humbly asking for any hint... Or someone else with the same observation ?

Thanks in advance !

Your UncleVan.Last edited by UncleVan on Thu Dec 15, 2011 1:22 pm; edited 1 time in total

----------

## EatMeerkats

Is CONFIG_PM_STD_PARTITION set correctly in the new kernel?

```
Symbol: PM_STD_PARTITION [=]

Type  : string

Prompt: Default resume partition

  Defined at kernel/power/Kconfig:68

  Depends on: HIBERNATION [=y]

  Location:

    -> Power management and ACPI options

      -> Hibernation (aka 'suspend to disk') (HIBERNATION [=y])
```

----------

## UncleVan

Sorry for not mention it:

  [*] Suspend to RAM and standby                                           

  [*] Hibernation (aka 'suspend to disk')                                  

  (/dev/sda1) Default resume partition                                     

  [*] Run-time PM core functionality                                       

  [*] Power Management Debug Support                                       

  [*]   Extra PM attributes in sysfs for low-level debugging/testing       

  [*]   Test suspend/resume and wakealarm during bootup                    

  [*] Suspend/resume event tracing                                         

  [*] ACPI (Advanced Configuration and Power Interface) Support  --->      

  [*] SFI (Simple Firmware Interface) Support  --->                        

  <M> APM (Advanced Power Management) BIOS support  --->                   

      CPU Frequency scaling  --->                                          

  -*- CPU idle PM support                                                  

  [*]   Cpuidle Driver for Intel Processors 

... etc.

Generally its not VERY different from tha old one here:

  [*] Suspend to RAM and standby 

  [*] Hibernation (aka 'suspend to disk') 

  (/dev/sda1) Default resume partition 

  [*] Run-time PM core functionality 

  [*] Power Management Debug Support 

  [*]   Extra PM attributes in sysfs for low-level debugging/testing 

  [*]   Test suspend/resume and wakealarm during bootup 

  [*] Suspend/resume event tracing 

  [*] ACPI (Advanced Configuration and Power Interface) Support  ---> 

  [*] SFI (Simple Firmware Interface) Support  ---> 

  < > APM (Advanced Power Management) BIOS support  ---> 

      CPU Frequency scaling  ---> 

  -*- CPU idle PM suppor 

  [*]   Cpuidle Driver for Intel Processors

except for the APM BIOS support, but there is nothing in the 3.0.6:

--- APM (Advanced Power Management) BIOS support

[ ]   Ignore USER SUSPEND            

[ ]   Enable PM at boot time

[ ]   Make CPU Idle calls when idle

[ ]   Enable console blanking using APM

[ ]   Allow interrupts during APM BIOS calls  

Nevertheless Ill remove it.

Thanks so far !

----------

## UncleVan

I seem to find a solution for the Thaw (or Resume from Hibernate) problem in kernel 3.0.6-gentoo on my ThinkPad Edge 11. 

1. One have to add the "resume=/dev/"resume partition" kernel boot parameter to the grub config line.

2. After building the new kernel version I emerged anew:

```
sys-power/pm-quirks

sys-power/pm-utils

sys-power/powermgmt-base

sys-power/upower

```

...and even 

```
sys-power/acpid

app-laptop/laptop-mode-tools

```

 - just to be sure....

3. After a suggestion from https://wiki.archlinux.org/index.php/Pm-utils#Resume_Hook

I included the pm-utils in the initramfs image:

```
zcat /boot/orig_initramfs > /path_to/initramfs

cd /

equery f pm-utils | cut -c2- |  cpio -o -H newc -AF /path_to/initramfs

```

 and also

```
echo "etc/pm/config.d/thinkpad_acpi" |  cpio -o -H newc -AF /path_to/initramfs

```

Then:

```
gzip -9 initramfs 

...and

cp initramfs.gz /boot/orig_initramfs

```

Now Im working the 5th. day in a row without hibernate/thaw problems; suspend to RAM/resume is also fine.

Can someone confirm or disprove ?

Thanks in advance !

Your UncleVan.

----------

## UncleVan

...but the day returns too soon...

(Tomorrow) today, of course, morning it did it again ! I'm out of ideas (for now); considering report it as a bug, if no one minds...

```
Dec 16 10:39:17 thinkkiste kernel: PM: Checking hibernation image partition /dev/sda1

Dec 16 10:39:17 thinkkiste kernel: PM follow: wait_for_device_probe() /dev/sda1

Dec 16 10:39:17 thinkkiste kernel: PM follow: scsi_complete_async_scans() /dev/sda1

Dec 16 10:39:17 thinkkiste kernel: PM: Hibernation image not present or could not be loaded.

Dec 16 10:39:17 thinkkiste kernel: IMA: No TPM chip found, activating TPM-bypass!

Dec 16 10:39:17 thinkkiste kernel: PM: Starting manual resume from disk

Dec 16 10:39:17 thinkkiste kernel: PM: Hibernation image partition 8:1 present

Dec 16 10:39:17 thinkkiste kernel: PM: Looking for hibernation image.

Dec 16 10:39:17 thinkkiste kernel: PM: Image not found (code -22)

Dec 16 10:39:17 thinkkiste kernel: PM: Hibernation image not present or could not be loaded.

```

Last edited by UncleVan on Wed Jan 11, 2012 8:51 pm; edited 1 time in total

----------

## Hu

 *UncleVan wrote:*   

> ...but the day returns too soon...
> 
> Tomorrow morning it did it again ! I'm out of ideas (for now); considering report it as a bug, if no one minds...
> 
> ```
> ...

 This appears to be a new problem.  Previously, your kernel did not attempt to resume.  Now, it attempts to resume, but finds no image that can be resumed.

----------

## UncleVan

Your right - should I open a new topic ? 

I just logicaly followed the "event-chain".. The main idea remains that thaw (resume from hibernate) has become instablle with the 3. kernel line. (there are lot of changes in the kernel/power/hibernate.c though...).

The last 3 days there were no fails , but I continue to monitor it - maybe someone else has same experience ?

Thanks so far !

Your UncleVan.

----------

## brodul

I am experiencing similar problems. 

```

[    0.000000] PM: Registered nosave memory: 000000000009d000 - 000000000009e000

[    0.000000] PM: Registered nosave memory: 000000000009e000 - 00000000000a0000

[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000d2000

[    0.000000] PM: Registered nosave memory: 00000000000d2000 - 00000000000d4000

[    0.000000] PM: Registered nosave memory: 00000000000d4000 - 00000000000e4000

[    0.000000] PM: Registered nosave memory: 00000000000e4000 - 0000000000100000

[    0.027803] PM: Registering ACPI NVS region at 7bb64000 (241664 bytes)

[    2.951252] PM: Checking hibernation image partition /dev/sda2

[    2.951265] PM: Hibernation image partition 8:2 present

[    2.951267] PM: Looking for hibernation image.

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

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

```

I tried the 3.0.6 and 3.1.7 kernel version.  

Have suspend and hibernate-script installed. I tried both 0.8-r1 and (~)1.0 suspend versions.

I do not use the initrd (I don't think I need it or do I ?).

I have this entry in grub:

```

title Gentoo Linux kernel-3.1.7-gentoo

root (hd0,0)

kernel /boot/kernel-3.1.7 root=/dev/sda3 resume=/dev/sda2 ro hpet=disable

```

Where /dev/sda2 is my swap. I also compiled the default resume volume to /dev/sda2 .

When I hibernate the s2disk starts. When it reaches 100% the computer is turned off.

/etc/suspend.conf looks like this:

```

snapshot device = /dev/snapshot

resume device = /dev/sda2

#image size = 350000000

#suspend loglevel = 2

compute checksum = y

compress = y

#encrypt = y

#early writeout = y

#splash = y

```

Any suggestions ?

P.S.

Sorry for dumping this topic.

----------

## UncleVan

- what a laptop do you have ?

I havent got problems for the last two weeks - even without pm-utils in the initramfs.gz - it looks weird though...   :Rolling Eyes: 

Im using the pm-utils :

sys-power/powermgmt-base-1.31  USE="pm-utils"

sys-power/pm-utils-1.4.1:0

sys-power/pm-quirks-20100619:0

but also:

sys-power/upower-0.9.13-r1:0

xfce-extra/xfce4-power-manager-1.0.10-r1:0

app-laptop/laptop-mode-tools-1.55-r3

  - and recompile them after each kernel rebuild.

you are using the user space software suspend, probably with sys-power/suspend + sys-power/hibernate-script wrapper.

You may look further at http://en.gentoo-wiki.com/wiki/Userspace_software_suspend

Can you pass the tests as described here: http://www.mjmwired.net/kernel/Documentation/power/basic-pm-debugging.txt ? For me it works basically when Ive started X  !? - Looking further...

So long !

Your UncleVan.

----------

## brodul

Tnx, 

I have an Acer TravelMate 5330 from year 2008.

I went through the test and:

# echo reboot > /sys/power/disk

# echo disk > /sys/power/state

worked !!!

So it was a script issue/conflict.

I "re emerged":

sys-power/powermgmt-base

sys-power/pm-utils

sys-power/pm-quirks

and I removed:

emerge --depclean sys-power/hibernate-script sys-power/suspend

And it works !  :Very Happy: 

TNX for your help

----------

