# Suspend to disk does not LOVE me!

## metacove

I have an emachines m5310 laptop and have everything working now. Powernow, acpi events, IGP DRI Support. I am running kernel 2.6.0-test6-mm1. I have tried the suspend functions ever since test4 and cannot seem to get it to work. I am calling on the experts now.

Here is my kernel config:

http://www.metacove.com/myconfig

It seems to suspend just fine when I execute:

```

echo -n disk > /sys/power/state

```

Yet when I reboot, it never detects that my swap partition contains the image. I am passing pmdisk=/dev/hda2 as well as resume=/dev/hda2 to try and make it pick it up from grub.

My swap partition is nearly 3 times my memory amount (1.5 gb swap, 512mb memory). I increased it thinking it was too close to the size of the memory.

Can some guru assist me and bring the love of software suspend to my box.

Thanks all!

----------

## delta407

Did you add 'resume=/dev/hda2' (insert your swap partition) to your kernel's boot parameters?

----------

## metacove

Yes (in the original post I mentioned this).

I wish that were all I needed.

----------

## delta407

 *metacove wrote:*   

> Yes (in the original post I mentioned this).

 Oh, sorry, didn't see it.  :Embarassed: 

 :Rolling Eyes: 

----------

## metacove

No problem =p

Do I need to try and make stuff more modular maybe ? Disable pre-empt ? I havent found a definitave guide because this is still evolving. It would be nice to have this though. Any more suggestions would be nice.

----------

## nephros

 *delta407 wrote:*   

> Did you add 'resume=/dev/hda2' (insert your swap partition) to your kernel's boot parameters?

 

Hmm, there are two different software suspend implementations in the 2.6 kernels right now.

The old one uses echo -n 4 > /proc/acpi/sleep and the resume=/dev/hdX kernel parameter.

The new one uses echo -n disk > /sys/power/state and the pmdisk=/dev/hdX kernel parameter, plus you can/have to specify the default suspend/resume partition in the kernel config.

Neither work for me (due to SMP), but I hope this still helps.

----------

## metacove

Thanks for the feedback. I do have the kernel parameters and have passed the proper options. I read the power documentation for the kernel source directory. I have tried to follow posts made by patrick mochel with the kernel development to see if I have left anything out. 

I can't seem to figure it out. Does suspend to disk just not work with some hardware or am I missing something ?

----------

## hiker

I have the same problem with my HP NX7000 Notebook and kernel 2.6.0-test6

----------

## metacove

That sucks. I guess I'll just keep waiting and hoping. Is there any info I should submit to lkml ?

----------

## David_V

Hi,

I have the exact same problem on my desktop computer.

I can suspend the computer without problems, and it seems to be doing its work at that point. However, when I reboot with the same parameters (pmdisk=/dev/hdb14 resume=/dev/hdb14) it just doesn't recognise my image on the disk (if there is one), and overwrites anything that might be there.

I did find a very interesting message in the output of dmesg, though:

```
Resume Machine: resuming from /dev/hdb14

Resuming from device hdb14

Resume Machine: This is normal swap space

PM: Reading pmdisk image.

PM: Resume from disk failed.

ACPI: (supports S0 S1 S4 S5) 
```

Hm, so the problem isn't anything with parameters, but the suspension struggles somehow. (Alternatively a fault in the resume routine.) Hmm...

I think I tried all possible ways of suspending now (using echo 4 > /proc/acpi/sleep , echo disk > /sys/power/state, swsusp (basically same as first)), but neither work.

Hopefully this issue will be resolved when 2.6.0 final comes out.

David

----------

## techiem2

ok.  I am sortoff successfully using suspend to disk.

I can do the

echo -n disk > /sys/power/state

and the machine will save the state and shutdown.

The machine will also restore the image on boot.

However, after a boot using a restore, I cannot suspend again.

I must boot the system normally in order to suspend again.

Any suggestions?

Kinda defeats the purpose of suspending.

 :Smile: 

I am using 2.6.0-test6-mm4

----------

## thundersteele

Same Situation here. 

Kernel 2.6.0-test9

Suspend to disk via "echo -n disk > /sys/power/state" and resume works perfectly once on my laptop. Even Internet connection is held open. Next time it won't suspend anymore. 

Problem (here) seemed to be "khubd", this process was marked with a "D"  (in top) after resume and suspend didn't get it to stop then. I tried on my desktop killing this Process, but it isn't possible. It is not marked with "D" here. 

Any solutions?

EDIT:

Well, made some tests. processes making problems (for me) were khubd and artsd. They don't wake up after resume, enter state D, and so they can't be stopped for another suspend. 

Ugly solution: Killing the processes before suspending helps. 

Better solution: I will try to use the suspend.sh script provided by http://swsusp.sourceforge.net but I don't know if this one is only for the 2.4 Kernel. Should be configurable what to do when suspending.

----------

## Hypnos

Hello,

I just moved to kernel 2.6.1.  I'm enjoying the enhanced performance and integrated ALSA, but no suspend implementation works for me:

* Stock swsusp -- saves image, reboots ad infinitum on reboot

* pmdisk -- locks trying to save image

Try various patchsets (mm-sources, gentoo-sources, vanilla+latest) has the same problems, or swsusp2 (continuing development of swsusp outside of kernel) has the same problem and it messes up stock swsusp and pmdisk by making them lock on suspend.

Any ideas?

Under 2.4.18, suspend works perfectly provided I stop/restart hotplugging and unload/reload my binary modem drivers.

----------

## Hypnos

Bah, suspend doesn't work.  I'm sticking with 2.4.18 until 2.6.x becomes the standard distro kernel -- hopefully all the kinks will have been worked out by then (probably ~2.6.10-20).

----------

## yamakawa

I think the final release of swsusp2 is fairly stable and reliable.

So far, I have been troubled with resume process of it. The keys are:

```
1) diabling preemption option, 

2) enabling force module removing, 

3) set troublesome modules into /etc/suspend.conf such as, usb, pcmcia, sound, and video related, 

4) ... I think that is it!
```

With these cares, I could just resumed ten consecutive times without any problem!!! This includes unpluging a usb mouse or/and a wireless pc-card after suspend and before resume.

The only trouble if any, is that the suspend.sh invokes a program in SWSUSP_START_PROGS_AFTER_RESUME before neccessary modules are loaded and the program therefore fails.

----------

## Hypnos

 *yamakawa wrote:*   

> I think the final release of swsusp2 is fairly stable and reliable.
> 
> So far, I have been troubled with resume process of it. The keys are:
> 
> ```
> ...

 

I hate you   :Razz: 

I could not solve my problem (infinite rebooting)  with swsusp2; I'll try again in a while ...

----------

## tuxlover

I was successful with swsusp2 and made a little how-to:

howto: get swsusp2 (hibernate, suspend to disk) working.

Have fun!

----------

## Hypnos

 *tuxlover wrote:*   

> I was successful with swsusp2 and made a little how-to:
> 
> howto: get swsusp2 (hibernate, suspend to disk) working.
> 
> Have fun!

 

Yup, 2.6.5+swsusp2 is the trick -- even works with pre-emptible kernel!

<< little dance

----------

