# thinkpad and suspend + sleep

## multix

Hi,

having a thinkpad, I'd like to have sleep and suspend working. Like the little orange moon led  :Smile: 

Now, what are the current kernel options to enable and which packages should I install?

Thank you. R.

----------

## audiodef

Get the tuxonice-sources and a kernel seed from Pappy.   :Cool: 

----------

## bbgermany

And depending on the model, you will get it working or not. My T61 with nvidia card doesnt work, but my X41 Tablet worked out of the box, without tux-on-ice sources, just pure gentoo sources.

bb

----------

## doctork

 *bbgermany wrote:*   

> And depending on the model, you will get it working or not. My T61 with nvidia card doesnt work, but my X41 Tablet worked out of the box, without tux-on-ice sources, just pure gentoo sources.
> 
> bb

 

Strange, my T61 with nvidia suspends just fine.  I haven't tried hibernate.  I'm using gentoo-sources, pm-utils, and powerdevil.

--

doc

----------

## dmpogo

I am happily hibernating and suspend-to-RAM X300 with tuxonice-patched kernel

----------

## ppurka

 *doctork wrote:*   

>  *bbgermany wrote:*   And depending on the model, you will get it working or not. My T61 with nvidia card doesnt work, but my X41 Tablet worked out of the box, without tux-on-ice sources, just pure gentoo sources.
> 
> bb 
> 
> Strange, my T61 with nvidia suspends just fine.  I haven't tried hibernate.  I'm using gentoo-sources, pm-utils, and powerdevil.
> ...

 T61 is working here too (nvidia with tuxonice-sources), both hibernate and suspend. But hibernate takes ~2min to resume.

----------

## Hypnos

On my T61 with Intel graphics, sleep is more robust than hibernation with tuxonice  :Razz: 

Sleep *always* works, and is fast as expected -- 2 seconds in or out.

Hibernation doesn't always work if my computer has been on the same boot for more than a few weeks.

----------

## dmpogo

 *Hypnos wrote:*   

> On my T61 with Intel graphics, sleep is more robust than hibernation with tuxonice 
> 
> Sleep *always* works, and is fast as expected -- 2 seconds in or out.
> 
> Hibernation doesn't always work if my computer has been on the same boot for more than a few weeks.

 

Do you hibernate to swap partition, and is it large enough ?

----------

## Hypnos

 *dmpogo wrote:*   

> Do you hibernate to swap partition, and is it large enough ?

 

Yes, and yes.  4GB swap for 2GB RAM, though I think may move to a swapfile instead in the future.

tuxonice tells you if it doesn't have enough room, and cleanly aborts.

----------

## dmpogo

 *Hypnos wrote:*   

>  *dmpogo wrote:*   Do you hibernate to swap partition, and is it large enough ? 
> 
> Yes, and yes.  4GB swap for 2GB RAM, though I think may move to a swapfile instead in the future.
> 
> tuxonice tells you if it doesn't have enough room, and cleanly aborts.

 

I kind of know, just trying to guess why the length of uptime can matter.Last edited by dmpogo on Thu Sep 10, 2009 1:38 pm; edited 1 time in total

----------

## Hypnos

Since I use sleep nearly all the time, I have not studied the issue extensively -- so take my report with a grain of salt  :Razz: 

----------

## DirtyHairy

I have suspend-to-RAM and suspend-to-disk working nicely on a T60 with a radeon X1300 (both with the proprietary drivers in the past and with the open source drivers nowadays) with the usual gentoo-sources (no tuxonice). No special kernel options were required apart from the usual power managment stuff and CPU hotplugging (necessary since one core must be disabled for sleep).

----------

## toralf

With my old T41 and my new T400 the current vanilla sources (2.6.30.6) works like a charm.

It is X11 which sometimes wants a Ctr-Alt-F1 + Ctrl-Alt-F7 after wakeup from hibernation to re-recognize my USB mouse.

----------

## multix

 *DirtyHairy wrote:*   

> I have suspend-to-RAM and suspend-to-disk working nicely on a T60 with a radeon X1300 (both with the proprietary drivers in the past and with the open source drivers nowadays) with the usual gentoo-sources (no tuxonice). No special kernel options were required apart from the usual power managment stuff and CPU hotplugging (necessary since one core must be disabled for sleep).

 

suspend to ram is the one turning on the small moon led, right?

I'd like to try out standard stuff first, if possible.

What options did you enable?

Did you need to install extra stuff?

How do you put your computer to sleep, how do you awaken it?

Are you able to bind the sleep action to the appropriate blue Fn key?

(and then the same question for suspend to disk...)

Thank you.

----------

## wilsonsamm

Which model do you have? APM or ACPI?

I remember that the 600e with an APM BIOS needed to have an adequately large file on a FAT16 formatted /dev/hda1. With ACPI, the linux kernel takes care of suspend/resume and uses the swap partition (needs to have enough free for the total amount of RAM, the Video RAM and a little spare)

----------

## dmpogo

 *wilsonsamm wrote:*   

> Which model do you have? APM or ACPI?
> 
> I remember that the 600e with an APM BIOS needed to have an adequately large file on a FAT16 formatted /dev/hda1. With ACPI, the linux kernel takes care of suspend/resume and uses the swap partition (needs to have enough free for the total amount of RAM, the Video RAM and a little spare)

 

We are mostly talking about suspend-to-RAM, which is not using disk space.  But you raise an important point - to check BIOS settings which may be suspend related.

I answered the wrong thread sorry   :Embarassed: 

----------

## ppurka

 *multix wrote:*   

>  *DirtyHairy wrote:*   I have suspend-to-RAM and suspend-to-disk working nicely on a T60 with a radeon X1300 (both with the proprietary drivers in the past and with the open source drivers nowadays) with the usual gentoo-sources (no tuxonice). No special kernel options were required apart from the usual power managment stuff and CPU hotplugging (necessary since one core must be disabled for sleep). 
> 
> suspend to ram is the one turning on the small moon led, right?
> 
> I'd like to try out standard stuff first, if possible.
> ...

 See the following guides. First follow them only up to the suspend to ram parts.

http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap7

http://rsalveti.wordpress.com/2007/05/21/making-suspend-to-ram-works-with-gentoo-thinkpad-t60/ (some of the information regarding s2ram here is old, but the hibernate-script information seems mostly correct).

----------

## DirtyHairy

 *Quote:*   

> suspend to ram is the one turning on the small moon led, right?

 

Yep, it is

 *Quote:*   

> What options did you enable?

 

Here is the power managment section of my kernel config:

```
#

# Power management and ACPI options

#

CONFIG_PM=y

# CONFIG_PM_DEBUG is not set

CONFIG_PM_SLEEP_SMP=y

CONFIG_PM_SLEEP=y

CONFIG_SUSPEND=y

CONFIG_SUSPEND_FREEZER=y

CONFIG_HIBERNATION=y

CONFIG_PM_STD_PARTITION=""

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_PROCFS=y

CONFIG_ACPI_PROCFS_POWER=y

CONFIG_ACPI_SYSFS_POWER=y

CONFIG_ACPI_PROC_EVENT=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=y

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_HOTPLUG_CPU=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_CUSTOM_DSDT is not set

CONFIG_ACPI_BLACKLIST_YEAR=2001

# CONFIG_ACPI_DEBUG is not set

# CONFIG_ACPI_PCI_SLOT is not set

CONFIG_X86_PM_TIMER=y

CONFIG_ACPI_CONTAINER=y

CONFIG_ACPI_SBS=y

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

CONFIG_CPU_FREQ_DEBUG=y

CONFIG_CPU_FREQ_STAT=y

# CONFIG_CPU_FREQ_STAT_DETAILS is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=y

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

# CONFIG_X86_POWERNOW_K8 is not set

# CONFIG_X86_GX_SUSPMOD is not set

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

CONFIG_X86_SPEEDSTEP_ICH=y

# CONFIG_X86_SPEEDSTEP_SMI is not set

# CONFIG_X86_P4_CLOCKMOD is not set

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

# CONFIG_X86_E_POWERSAVER is not set

#

# shared options

#

CONFIG_X86_SPEEDSTEP_LIB=y

# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y
```

Of course, you need to review and adapt this to your machine

 *Quote:*   

> Did you need to install extra stuff?

 

No, but for convenience, I installed hibernate-script.

 *Quote:*   

> How do you put your computer to sleep, how do you awaken it?

 

I'm using hibernate-script (hibernate-ram and friends) for convenience, but the basic thing is

```
echo -n mem > /sys/power/state
```

The machine awakens by closing and reopening the lid or by pressing Fn.

 *Quote:*   

> Are you able to bind the sleep action to the appropriate blue Fn key?

 

Yes, I am. Look at the thinkpad-acpi kernel driver; this allows to generate ACPI events for the Fn+X stuff which then can be handled by acpid.

 *Quote:*   

> (and then the same question for suspend to disk...)

 

Same answer, however, you need to set the resume kernel parameter to the swap partition (and it's "disk" instead of "mem").

 *Quote:*   

> Thank you.

 

You're welcome  :Smile: 

----------

## Hypnos

FYI, if you use GNOME, suspend/hibernate through the GNOME power manager should "just work."

----------

## multix

Just a follow-up. Using gentoo-sources kernel ( 2.6.30-gentoo-r6 )with its standard configuration script, I am able to run the command "hibernate-ram" and it works fine.

That is a good start, thank you for your help.

I did not try suspend-to-disk yet, since I need to modify the command line. My swap partition is bigger than my ram amount, so I guess that should work too.

I still need to work out how to bind to the Fn-4 and Fn-12 Key, they do nothing currently.

Also closing the lid does nothing, but I want that to remain so, I often close the laptop lid and use it with an external monitor and keyboard, so the keys would be more than enough.

Is there a configurable way to accomplish both of my goals?

----------

## multix

 *Hypnos wrote:*   

> FYI, if you use GNOME, suspend/hibernate through the GNOME power manager should "just work."

 

That would be too easy... I don't use GNOME.  I use GNUstep. Now a good way to write a power utility though is worth another thread. Since you put in your signature "etoileos" you might be interested. I'm the author of GAP's battery monitor...

Riccardo

----------

## KloBass

Hello did someone solved that thinkpad is not resuming correctly? It will power on but moon led is still shining - i can turn on thinklight or enable capslock or so.. but blank screen all the time ( blank like without power) tried tuxonice kernel patch, vannila sources or gentoo sources, also hibernate scripts or s2ram (with all available options). still same result. hibernation works everytime. suspend not will not resume. 

Also tried suspend from init=/bin/bash without framebuffer or KMS. still same result. 

Thinkpad X200 intel integrated graphics, intel wifi

----------

## Hypnos

KloBass,

Your LCD panel is off, but is your computer on when you resume from suspend?  If your computer doesn't turn on then it's a much more cryptic problem than your LCD panel not being reactivated by the video card.

Which precise Intel Graphics and WiFi do you have?  If the graphics too old (e.g., i915) or your WiFi too new (e.g., 5600) it may not work.

One thing to try is to not start X, and see if you can suspend and resume properly from the console.  You can suspend manually from a root shell with (I think)

```
# echo mem > /sys/power/state
```

Also, without the WiFi driver loaded.

----------

## KloBass

 *Hypnos wrote:*   

> Your LCD panel is off, but is your computer on when you resume from suspend?  If your computer doesn't turn on then it's a much more cryptic problem than your LCD panel not being reactivated by the video card.
> 
> 

 

dont know really - sleep led is still on - but harddrive led is blinking sometimes. also SYSRQ is working

 *Hypnos wrote:*   

> 
> 
> Which precise Intel Graphics and WiFi do you have?  If the graphics too old (e.g., i915) or your WiFi too new (e.g., 5600) it may not work.
> 
> 

 

Network controller: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection

Mobile Intel® GM45 Express Chipset

 *Hypnos wrote:*   

> 
> 
> One thing to try is to not start X, and see if you can suspend and resume properly from the console.  You can suspend manually from a root shell with (I think)
> 
> ```
> ...

 

I mentioned above that i tried it.  without X wlan only with init=/bin/bash and mounted /proc and /sys with echo -n "mem"  > ...

----------

## Hypnos

 *KloBass wrote:*   

> I mentioned above that i tried it.  without X wlan only with init=/bin/bash and mounted /proc and /sys with echo -n "mem"  > ...

 

Sorry, missed that part.  I guess the only easy thing left to try is to not have the WiFi driver installed.

----------

## KloBass

 *Hypnos wrote:*   

>  *KloBass wrote:*   I mentioned above that i tried it.  without X wlan only with init=/bin/bash and mounted /proc and /sys with echo -n "mem"  > ... 
> 
> Sorry, missed that part.  I guess the only easy thing left to try is to not have the WiFi driver installed.

 

well i thought that disabling it in bios and not loading module will be enough but ill give it try.

----------

## Hypnos

 *KloBass wrote:*   

> well i thought that disabling it in bios and not loading module will be enough but ill give it try.

 

It should be.

Other than successively disabling all device drivers and trying to suspend from console, I have no other ideas ...

----------

