Difference between revisions of "How to make ACPI work"

From ThinkWiki
Jump to: navigation, search
m (Suspend to RAM (Sleep))
(Screen blanking (Standby))
 
(66 intermediate revisions by 39 users not shown)
Line 1: Line 1:
==general==
+
==General==
 +
First, simply try using the power management features of Linux on your computer. Tell Linux to suspend (System > Preferences > Power Management in Gnome).  Try closing the lid.    ACPI may already work.
 +
 
 +
===Update BIOS===
 +
ACPI requires a relatively new BIOS version.  In particular, if you get the message,
 +
  ACPI: Could not use ECDT
 +
during startup, you probably need a [[BIOS Upgrade]].  For example, a BIOS upgrade from version 1.02 to 1.10 was all that was needed for ACPI to start working on an A31 2652 running Red Hat Enterprise Linux 5 (CentOS 5).
 +
 
 
===Kernel configuration===
 
===Kernel configuration===
First of all you'll have to enable ACPI support in your kernel (if your distro doesn't already have an ACPI enabled kernel).
+
Many Kernel 2.6 distributions like Red Hat Enterprise Linux 5 (Centos 5) have ACPI built in and ready to go.  If not, you must enable ACPI support in your kernel.
 +
 
 
To do this open your kernel config and enable ACPI Power Management:
 
To do this open your kernel config and enable ACPI Power Management:
:{{kernelconf||||Power management options|Power Management support|<*>|CONFIG_PM}}
+
:{{kernelconf|CONFIG_PM|<*>|Power Management support|Power management options|||}}
:{{kernelconf||||Power management options|ACPI|<*>|CONFIG_ACPI_SLEEP}}
+
:{{kernelconf|CONFIG_ACPI|<*>|ACPI Support|Power management options|||}}
  
 
You'd most likely want to enable the following ACPI options:
 
You'd most likely want to enable the following ACPI options:
:{{kernelconf|||Power management options|ACPI|Sleep States|<*>|CONFIG_ACPI_SLEEP}}
+
:{{kernelconf|CONFIG_SUSPEND|<*>|Suspend to RAM and standby|Power management options|||}}
:{{kernelconf|||Power management options|ACPI|AC Adapter|<*>|CONFIG_ACPI_AC}}
+
:{{kernelconf|CONFIG_ACPI_AC|<*>|AC Adapter|ACPI|Power management options||}}
:{{kernelconf|||Power management options|ACPI|Battery|<*>|CONFIG_ACPI_BATTERY}}
+
:{{kernelconf|CONFIG_ACPI_BATTERY|<*>|Battery|ACPI|Power management options||}}
:{{kernelconf|||Power management options|ACPI|Fan|<*>|CONFIG_ACPI_FAN}}
+
:{{kernelconf|CONFIG_ACPI_BUTTON|<*>|Button|ACPI|Power management options||}}
:{{kernelconf|||Power management options|ACPI|Processor|<*>|CONFIG_ACPI_PROCESSOR}}
+
:{{kernelconf|CONFIG_ACPI_FAN|<*>|Fan|ACPI|Power management options||}}
:{{kernelconf|||Power management options|ACPI|Thermal Zone|<*>|CONFIG_ACPI_THERMAL}}
+
:{{kernelconf|CONFIG_ACPI_PROCESSOR|<*>|Processor|ACPI|Power management options||}}
 +
:{{kernelconf|CONFIG_ACPI_THERMAL|<*>|Thermal Zone|ACPI|Power management options||}}
  
 
If you prefer editing your {{path|.config}} file directly, you should set at least the following variables:
 
If you prefer editing your {{path|.config}} file directly, you should set at least the following variables:
 
  CONFIG_PM=y
 
  CONFIG_PM=y
  CONFIG_ACPI_BOOT=y
+
  CONFIG_ACPI=y
CONFIG_ACPI_INTERPRETER=y
 
CONFIG_ACPI_SLEEP=y
 
CONFIG_ACPI_SLEEP_PROC_FS=y
 
 
  CONFIG_ACPI_AC=y
 
  CONFIG_ACPI_AC=y
 
  CONFIG_ACPI_BATTERY=y
 
  CONFIG_ACPI_BATTERY=y
Line 26: Line 32:
 
  CONFIG_ACPI_PROCESSOR=y
 
  CONFIG_ACPI_PROCESSOR=y
 
  CONFIG_ACPI_THERMAL=y
 
  CONFIG_ACPI_THERMAL=y
  CONFIG_ACPI_BUS=y
+
  CONFIG_ACPI_BLACKLIRG_YEAR=0
 
  CONFIG_ACPI_EC=y
 
  CONFIG_ACPI_EC=y
 
  CONFIG_ACPI_POWER=y
 
  CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
 
 
  CONFIG_ACPI_SYSTEM=y
 
  CONFIG_ACPI_SYSTEM=y
  
Then recompile your kernel.
+
Then recompile your kernel.  
 +
 
 +
{{HINT| ACPI SLEEP States option did only show up for me after patching [[Software Suspend 2]] into the kernel. With a vanilla 2.6.17 kernel, one must enable CONFIG_SMP and CONFIG_HOTPLUG_CPU for the option to appear, cf. [http://bugs.debian.org/383059 Debian bug #383059] .
 +
(This should be fixed in 2.6.23, there are new CONFIG_SUSPEND and CONFIG_HIBERNATION config options)}}
 +
 
 +
===Kernel boot parameters===
 +
Many ThinkPads have been hit by a recent (kernel 2.6.16) change to ACPI4Linux that changed the default means of accessing the ACPI Embedded Controller as a way to shake out underlying bugs in the EC access code. If your ThinkPad fails to resume properly (a blinking Sleep light on resume that doesn't go away, or a hang when trying to suspend/standby a second time), adding {{bootparm|ec_intr|0}} to your kernel command line may help.
 +
 
 +
===ThinkPad specific ACPI driver===
 +
 
 +
If you are using kernel version 2.6.22 and later, please use the [[thinkpad-acpi]] driver included with the kernel.
 +
 
 +
{{HINT|Generally it is a good idea to read the README included with the driver.}}
 +
 
 +
===Backlight problems with post-2.6.26 kernels===
 +
 
 +
According to [[http://www.nabble.com/T61-Brightness-keys-with-2.6.26-not-working-(NVIDIA)-td18577619.html this thread]], users with 2.6.26 kernel and higher may experience problems with ThinkPad backlight contols ('''Fn+Home''', '''Fn+End''' on T61). The symptoms are:
 +
* backlight brightness controls do not work;
 +
* Using '''acpi_listen''' command, there is no reaction for '''brightness down''' button, but '''brightenss up''' gives:
 +
  ibm/hotkey HKEY 00000080 00001010
  
===IBM specific ACPI driver===
+
The solution is that one needs to enable `CONFIG_VIDEO_OUTPUT_CONTROL`:
Unfortunately, special drivers for ACPI on ThinkPads were not included with kernels prior 2.6.10. So you'll have to compile one yourself or get it as precompiled module for your kernel.
+
Device Drivers  --->
 +
  Graphics Support  --->
 +
    <*> Lowlevel video output switch controls
  
You have the choice between [[thinkpad-acpi]] and [[ibm-acpi]], with the latter being the recommended one.
+
Subsequently one should enable 'CONFIG_ACPI_VIDEO':
 +
Power Management Options  --->
 +
  [*] ACPI (Advanced Configuration and Power Interface) Support  --->
 +
    <*> Video
  
If you use a post-2.6.10 kernel and you want to use [[ibm-acpi]], it is recommended to look on its projects page for a possibly newer version.
+
{{NOTE|Without `CONFIG_VIDEO_OUTPUT_CONTROL` enabled, one will not be able to enable `CONFIG_ACPI_VIDEO` in menuconfig or similar interface as the option will remain hidden}}
  
{{HINT|In general it is a good idea to read the README included with the driver.}}
+
===ACPI S4 hardware signature mismatch===
 +
 
 +
Around kernel 2.6.27, a feature was introduced to check the hardware signature on resume from S4 (hibernate). This feature might be broken on some models. Resume will halt and the following error message is shown:
 +
:ACPI: Hardware changed while hibernated, cannot resume!
 +
:Kernel panic - not syncing: ACPI S4 hardware signature mismatch
 +
To fix it, add the following kernel parameter:
 +
:acpi_sleep=s4_nohwsig
 +
This problem appeared here on a T42p, but only if the power is unplugged while hibernated, even if the battery is still plugged. Another sympton is, that resume hangs with a dark screen if the acpi_cpufreq module is loaded, even if the power is not unplugged while hibernated. With the above mentioned kernel parameter, both problems go away.
  
 
===ACPI daemon===
 
===ACPI daemon===
 
Also you'll need to install [[acpid]], if it isn't present on your system. [[acpid]] is a daemon that handles the ACPI events generated by the system. Read [[How to configure acpid]].
 
Also you'll need to install [[acpid]], if it isn't present on your system. [[acpid]] is a daemon that handles the ACPI events generated by the system. Read [[How to configure acpid]].
 +
 +
{{NOTE|For [[acpid]] to work, the ACPI event interface <TT>/proc/acpi/event</TT> must be configured in the kernel (via <TT>CONFIG_ACPI_PROC_EVENT</TT>).  As of kernel 2.6.25, this interface is deprecated.  ACPI events are now distributed through the kernel's input event framework, making [[acpid]] redundant and, ultimately, obsolete.  However, userspace utilities have been slow to migrate toward the new interface, and many Linux distributions continue to enable the old interface.  Check your kernel configuration, or check to see if <TT>/proc/acpi/event</TT> exists.}}
  
 
==Screen blanking (Standby)==
 
==Screen blanking (Standby)==
Line 51: Line 89:
 
in the Monitor section of your {{path|/etc/X11/XF86Config}} or {{path|/etc/X11/xorg.conf}}.
 
in the Monitor section of your {{path|/etc/X11/XF86Config}} or {{path|/etc/X11/xorg.conf}}.
  
Running {{cmd|xset +dpms}} and then {{cmd|xset dpms force off}} will turn off the backlight on a laptop screen.<br />
+
Running {{cmduser|xset +dpms}} and then {{cmduser|xset dpms force off}} will turn off the backlight on a laptop screen.<br />
  
Note that this may not work in combination with {{cmd|echo -n "mem" > /sys/power/state}} because switching to console causes the backlight to come back on before sleeping.
+
Note that this may not work in combination with {{cmduser|echo -n "mem" > /sys/power/state}} because switching to console causes the backlight to come back on before sleeping.
 +
 
 +
See also [[How to reduce power consumption#LCD Backlight/Brightness]]
  
 
==Suspend to RAM (Sleep)==
 
==Suspend to RAM (Sleep)==
 
ACPI Sleep/suspend-to-ram with recent 2.6.x kernels usually works fine. Have a look at the [[How to configure acpid|acpid configuration HOWTO]]. It includes a specific example for going to sleep on lid close.
 
ACPI Sleep/suspend-to-ram with recent 2.6.x kernels usually works fine. Have a look at the [[How to configure acpid|acpid configuration HOWTO]]. It includes a specific example for going to sleep on lid close.
  
The following glitches may or may not occur in relation to suspending to RAM:
+
For Troubleshooting, look at the [[Problems with ACPI suspend-to-ram|Problems with ACPI suspend-to-ram page]].
* If your suspend is failing, and a {{cmdroot|tail /var/log/acpid}} shows "Permission denied" errors, be sure that your new ACPI event and action scripts have the appropriate permissions.
 
* When resuming from a suspend-to-ram the display might remain black or might only show the pre-suspend output (the system is still rebootable via {{key|ctrl}}{{key|alt}}{{key|del}}). Look [[Problem with display remaining black after resume|here]] for solutions.
 
* When your system is equiped with a Radeon Mobility graphic controller your [[Problem with LCD backlight remaining on during ACPI sleep|LCD backlight may not turn off automatically]]. Use [[radeontool]] to switch off your backlight prior suspend in your sleep action script.
 
* Also, you might want to take note of the [[Problem with high power drain in ACPI sleep]].
 
* You may experience problems when using {{cmdroot|echo standby > /sys/power/state}} (machine goes to sleep and wakes up immediately). This can be avoided by using {{cmdroot|echo -n 3 >/proc/acpi/sleep}} to get it to sleep. This can be also happen if hotplug daemon is still running.
 
* If you're running MySQL, sleep may also not work, so stop MySQL first, then sleep. Remember to restart MySQL when you wakeup.
 
* Problems with the serial port of the port replicator after the wake up from ram have also been experienced.
 
* Crash on resume
 
** ...when using ATI proprietary drivers can be solved by using [http://freshmeat.net/projects/vbetool/ vbetool].
 
** ...might be solved by disabling ''APIC'' (@Processor type and features) in the kernel configuration
 
* Due to the fact that Sonoma chipset based laptops (T43, T43p) utilize the SATA layer for disk access and SATA does not have power-management support yet Suspend to RAM does not work on these machines. However, Jens Axboe's patch ([http://marc.theaimsgroup.com/?l=linux-kernel&m=111504542402455&w=2] LKML posting) provides SATA power-management support and makes Suspend to RAM work on the T43 at least. (Tested on 2.6.12rc6 which the patch applies to with some offsets. T43p not tested but should work as well. X41: uses SATA also and works with ACPI sleep after this patch applied (with acpi_sleep=s3_bios), but still hung with APM sleep (acpi=off) when recovering from suspend. R52 uses SATA and sleep doesn't work, so it is probably affected too). Ubuntu Breezy includes this patch, so you don't need to apply it and build the kernel.
 
** [http://shamrock.dyndns.org/~ln/linux/sata_pm.2.6.12.diff 2.6.12 patch]
 
** [http://shamrock.dyndns.org/~ln/linux/sata_pm.2.6.13-rc5.diff 2.6.13-rc5 patch]
 
** [http://lkml.org/lkml/2005/9/23/97 Post on how to patch later (2.6.14-rc) kernels]
 
  
 
==Suspend to disk (Hibernate)==
 
==Suspend to disk (Hibernate)==
 
There are two drivers for this available:
 
There are two drivers for this available:
* swsusp, which is in the kernel and
+
* [[swsusp]], which is in the kernel and
* [http://developer.berlios.de/projects/softwaresuspend/ SoftwareSuspend2] which is more feature rich, but not yet in the kernel, so you have to patch it in yourself
+
* [[TuxOnIce]] which is more feature rich, but not yet in the kernel, so you have to patch it in yourself.
 +
 
 
Both are reported to work fine as long as you use open-source graphic drivers. A comparison of the features can be found on [http://softwaresuspend.berlios.de/features.html this page].
 
Both are reported to work fine as long as you use open-source graphic drivers. A comparison of the features can be found on [http://softwaresuspend.berlios.de/features.html this page].
  
 
Just in case you are in doubt...yes, it is safe in both cases to use the same swap partition as active swap and as suspend partition.
 
Just in case you are in doubt...yes, it is safe in both cases to use the same swap partition as active swap and as suspend partition.
  
===using swsusp===
+
See the according drivers page for instructions.
Software Suspend (swsusp) is included in the 2.6 kernel series. It seems like no patches for 2.4 kernels are available.
 
 
 
To enable software suspend change your kernel config as follows:
 
:{{kernelconf||||Power management options|Power management support|<*>|CONFIG_PM}}
 
:{{kernelconf||||Power management options|Software Suspend|<*>|CONFIG_SOFTWARE_SUSPEND}}
 
:{{kernelconf||||Power management options|Default resume partition|[/dev/resume_partition]|CONFIG_PM_STD_PARTITION}}
 
 
 
<tt>/dev/resume_partition</tt> needs to be replaced by the swap partition you want to use for suspending. (Use {{cmdroot|fdisk -l /dev/hda}} if unsure.)
 
 
 
You can override the default resume partition anytime by giving {{bootparm|resume|/dev/resume_partition}} as kernel boot parameter.
 
Also, in case you suspended, but want to boot up normally (without resuming from the saved image - losing all data that was unsaved at suspend time), you can give the <tt>noresume</tt> kernel boot parameter.
 
 
 
(In my case, and according to reports from several people, suspending does not work if resume_partition is specified in the kernel config (my version is 2.6.12-3 from kernel.org). It works as a charm if one specifies the resume partition as a kernel parameter instead.)
 
 
 
To suspend you can either do a simple {{cmdroot|echo -n 4 > /proc/acpi/sleep}} (recommended) or use the [http://softwaresuspend.berlios.de/old-site/swsusp/sysvinit-2.76-v2-for_swsusp-v5.tar.gz patched SysVInit] and call {{cmdroot|swsusp}} or {{cmdroot|shutdown -z now}}.
 
 
 
Ideally you would do this from a script like {{path|/etc/acpi/actions/hibernate.sh}}. It has proven to be a good idea to shutdown the following processes/drivers within the script before you do the actual suspend.
 
*any running mysql server
 
*the linuxant driver may require stopping in a acpi script as well. {{cmdroot|dldrstop}} does the trick.
 
 
 
Afterwards you might want to enable them again, as well as run a script that does necessary configurations according to the ac power state.
 
Furthermore, the system clock is not readjusted automatically, so you will probably also want the do that from that script (i.e. by restarting your systemclock bootup script).
 
 
 
If the sound output is silent after resume, these commands might help to get sound to work again without reloading any modules:
 
 
 
amixer set Master mute >/dev/null 2>&1
 
amixer set PCM mute >/dev/null 2>&1
 
amixer set Master unmute >/dev/null 2>&1
 
amixer set PCM unmute >/dev/null 2>&1
 
 
 
Finally you should take note that swsusp does not set the ACPI S4 state. Instead it goes to S5. This means that the machine itself doesn't know that it was suspend rather than shutdown. Hence you can i.e. boot a parallel installed other operating system and resume your linux session later, as long as you don't touch the swap partition the image was saved to.
 
 
 
===using SoftwareSuspend2===
 
First apply Software Suspend 2 patches from http://www.suspend2.net if they are not already in your kernel.
 
 
 
Be sure to also read the http://www.suspend2.net/HOWTO.html
 
 
 
These are the options for the kernel. Make sure to change the <tt>/dev/resume_partition</tt> to your swap partition, i.e. <tt>/dev/hda5</tt>.
 
  
# Software Suspend 2
+
== Troubleshooting ==
CONFIG_SOFTWARE_SUSPEND2=y
 
CONFIG_SOFTWARE_SUSPEND2_BUILTIN=y
 
CONFIG_SOFTWARE_SUSPEND_SWAPWRITER=y
 
CONFIG_SOFTWARE_SUSPEND_LZF_COMPRESSION=y
 
CONFIG_SOFTWARE_SUSPEND_TEXT_MODE=y
 
CONFIG_SOFTWARE_SUSPEND_DEFAULT_RESUME2="/dev/resume_partition"
 
# CONFIG_SOFTWARE_SUSPEND_KEEP_IMAGE is not set
 
CONFIG_SOFTWARE_SUSPEND_CHECK_RESUME_SAFE=y
 
# CONFIG_SOFTWARE_SUSPEND_DEBUG is not set
 
# CONFIG_SOFTWARE_SUSPEND_DEVELOPER is not set
 
  
Next, compile and install the kernel.
+
=== Machine reboots after shutting down ===
  
In the meantime, add the following to the kernel parameters: {{bootparm|resume2|swap:/dev/resume_partition}}. Again change <tt>/dev/resume_partition</tt> to your swap partition.
+
Try removing ehci_hcd before shutting down, eg, add the following line to rc.local.shutdown
  
Install the hibernation script:
+
rmmod ehci_hcd
*For {{Gentoo}} users: emerge hibernate-script<br />
 
*For {{Fedora}} users: kernel and hibernate RPMs are available at http://mhensler.de/swsusp/<br />
 
*For all other users, check the home page for packages (deb, i386 rpm, tgz, and source rpm) from http://www.suspend2.net
 
*{{Debian}} users using initrd image, make sure you copy [http://dagobah.ucc.asn.au/swsusp/2.0.0.102/swsusp-initrd.sh swsusp-initrd.sh] script to your {{path|/etc/mkinitrd/scripts}} directory before creating initrd image.
 
  
Restart using the new kernel and run the script to test it: {{cmdroot|/usr/sbin/hibernate}}
+
Needed on {{X220}} and {{X230|Reboots after shutting down}}.
  
 
==ThinkPads on which it is recommended to use ACPI==
 
==ThinkPads on which it is recommended to use ACPI==
Line 150: Line 125:
 
*ThinkPad {{A20m}}, {{A20p}}, {{A20m}}, {{A20p}}, {{A21e}}, {{A21m}}, {{A21p}}, {{A22e}}, {{A22m}}, {{A22p}}, {{A30}}, {{A30p}}, {{A31}}, {{A31p}}
 
*ThinkPad {{A20m}}, {{A20p}}, {{A20m}}, {{A20p}}, {{A21e}}, {{A21m}}, {{A21p}}, {{A22e}}, {{A22m}}, {{A22p}}, {{A30}}, {{A30p}}, {{A31}}, {{A31p}}
 
*ThinkPad {{G40}}, {{G41}}
 
*ThinkPad {{G40}}, {{G41}}
*ThinkPad {{R30}}, {{R31}}, {{R32}}, {{R40}}, {{R40e}}, {{R50}}, {{R50p}}, {{R51}}, {{R52}}
+
*ThinkPad {{R30}}, {{R31}}, {{R32}}, {{R40}}, {{R40e}}, {{R50}}, {{R50e}}, {{R50p}}, {{R51}}, {{R52}}, {{R60}}
*ThinkPad {{T20}}, {{T21}}, {{T22}}, {{T23}}, {{T30}}, {{T40}}, {{T40p}}, {{T41}}, {{T41p}}, {{T42}}, {{T42p}}, {{T43}}, {{T43p}}
+
*ThinkPad {{T22}}, {{T23}}, {{T30}}, {{T40}}, {{T40p}}, {{T41}}, {{T41p}}, {{T42}}, {{T42p}}, {{T43}}, {{T43p}}, {{T61}}
 
*ThinkPad {{X20}}, {{X21}}, {{X22}}, {{X23}}, {{X24}}, {{X30}}, {{X31}}, {{X32}}, {{X40}}, {{X41}}, {{X41T}}
 
*ThinkPad {{X20}}, {{X21}}, {{X22}}, {{X23}}, {{X24}}, {{X30}}, {{X31}}, {{X32}}, {{X40}}, {{X41}}, {{X41T}}
 +
*ThinkPad {{Z60t}}, {{Z60m}}, {{Z61m}}
 +
*ThinkPad {{X60s}}
 
*ThinkPad {{TransNote}}
 
*ThinkPad {{TransNote}}
 +
*ThinkPad {{T20}} and {{T21}} have old ACPI implementations, but there have been some reports of using ACPI successfully on these models with Ubuntu and Mandriva in particular. Check the related pages about installing Linux on these models for details.

Latest revision as of 02:24, 28 October 2015

General

First, simply try using the power management features of Linux on your computer. Tell Linux to suspend (System > Preferences > Power Management in Gnome). Try closing the lid. ACPI may already work.

Update BIOS

ACPI requires a relatively new BIOS version. In particular, if you get the message,

  ACPI: Could not use ECDT

during startup, you probably need a BIOS Upgrade. For example, a BIOS upgrade from version 1.02 to 1.10 was all that was needed for ACPI to start working on an A31 2652 running Red Hat Enterprise Linux 5 (CentOS 5).

Kernel configuration

Many Kernel 2.6 distributions like Red Hat Enterprise Linux 5 (Centos 5) have ACPI built in and ready to go. If not, you must enable ACPI support in your kernel.

To do this open your kernel config and enable ACPI Power Management:

Power management options → <*>Power Management support (CONFIG_PM)
Power management options → <*>ACPI Support (CONFIG_ACPI)

You'd most likely want to enable the following ACPI options:

Power management options → <*>Suspend to RAM and standby (CONFIG_SUSPEND)
Power management options → ACPI → <*>AC Adapter (CONFIG_ACPI_AC)
Power management options → ACPI → <*>Battery (CONFIG_ACPI_BATTERY)
Power management options → ACPI → <*>Button (CONFIG_ACPI_BUTTON)
Power management options → ACPI → <*>Fan (CONFIG_ACPI_FAN)
Power management options → ACPI → <*>Processor (CONFIG_ACPI_PROCESSOR)
Power management options → ACPI → <*>Thermal Zone (CONFIG_ACPI_THERMAL)

If you prefer editing your .config file directly, you should set at least the following variables:

CONFIG_PM=y
CONFIG_ACPI=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_BLACKLIRG_YEAR=0
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y

Then recompile your kernel.

Hint:
ACPI SLEEP States option did only show up for me after patching Software Suspend 2 into the kernel. With a vanilla 2.6.17 kernel, one must enable CONFIG_SMP and CONFIG_HOTPLUG_CPU for the option to appear, cf. Debian bug #383059 .

(This should be fixed in 2.6.23, there are new CONFIG_SUSPEND and CONFIG_HIBERNATION config options)

Kernel boot parameters

Many ThinkPads have been hit by a recent (kernel 2.6.16) change to ACPI4Linux that changed the default means of accessing the ACPI Embedded Controller as a way to shake out underlying bugs in the EC access code. If your ThinkPad fails to resume properly (a blinking Sleep light on resume that doesn't go away, or a hang when trying to suspend/standby a second time), adding ec_intr=0 to your kernel command line may help.

ThinkPad specific ACPI driver

If you are using kernel version 2.6.22 and later, please use the thinkpad-acpi driver included with the kernel.

Hint:
Generally it is a good idea to read the README included with the driver.

Backlight problems with post-2.6.26 kernels

According to [this thread], users with 2.6.26 kernel and higher may experience problems with ThinkPad backlight contols (Fn+Home, Fn+End on T61). The symptoms are:

  • backlight brightness controls do not work;
  • Using acpi_listen command, there is no reaction for brightness down button, but brightenss up gives:
 ibm/hotkey HKEY 00000080 00001010

The solution is that one needs to enable `CONFIG_VIDEO_OUTPUT_CONTROL`:

Device Drivers  --->
  Graphics Support  --->
    <*> Lowlevel video output switch controls

Subsequently one should enable 'CONFIG_ACPI_VIDEO':

Power Management Options  --->
  [*] ACPI (Advanced Configuration and Power Interface) Support  --->
    <*> Video
NOTE!
Without `CONFIG_VIDEO_OUTPUT_CONTROL` enabled, one will not be able to enable `CONFIG_ACPI_VIDEO` in menuconfig or similar interface as the option will remain hidden

ACPI S4 hardware signature mismatch

Around kernel 2.6.27, a feature was introduced to check the hardware signature on resume from S4 (hibernate). This feature might be broken on some models. Resume will halt and the following error message is shown:

ACPI: Hardware changed while hibernated, cannot resume!
Kernel panic - not syncing: ACPI S4 hardware signature mismatch

To fix it, add the following kernel parameter:

acpi_sleep=s4_nohwsig

This problem appeared here on a T42p, but only if the power is unplugged while hibernated, even if the battery is still plugged. Another sympton is, that resume hangs with a dark screen if the acpi_cpufreq module is loaded, even if the power is not unplugged while hibernated. With the above mentioned kernel parameter, both problems go away.

ACPI daemon

Also you'll need to install acpid, if it isn't present on your system. acpid is a daemon that handles the ACPI events generated by the system. Read How to configure acpid.

NOTE!
For acpid to work, the ACPI event interface /proc/acpi/event must be configured in the kernel (via CONFIG_ACPI_PROC_EVENT). As of kernel 2.6.25, this interface is deprecated. ACPI events are now distributed through the kernel's input event framework, making acpid redundant and, ultimately, obsolete. However, userspace utilities have been slow to migrate toward the new interface, and many Linux distributions continue to enable the old interface. Check your kernel configuration, or check to see if /proc/acpi/event exists.

Screen blanking (Standby)

Make sure you have

Option "DPMS"

in the Monitor section of your /etc/X11/XF86Config or /etc/X11/xorg.conf.

Running $ xset +dpms and then $ xset dpms force off will turn off the backlight on a laptop screen.

Note that this may not work in combination with $ echo -n "mem" > /sys/power/state because switching to console causes the backlight to come back on before sleeping.

See also How to reduce power consumption#LCD Backlight/Brightness

Suspend to RAM (Sleep)

ACPI Sleep/suspend-to-ram with recent 2.6.x kernels usually works fine. Have a look at the acpid configuration HOWTO. It includes a specific example for going to sleep on lid close.

For Troubleshooting, look at the Problems with ACPI suspend-to-ram page.

Suspend to disk (Hibernate)

There are two drivers for this available:

  • swsusp, which is in the kernel and
  • TuxOnIce which is more feature rich, but not yet in the kernel, so you have to patch it in yourself.

Both are reported to work fine as long as you use open-source graphic drivers. A comparison of the features can be found on this page.

Just in case you are in doubt...yes, it is safe in both cases to use the same swap partition as active swap and as suspend partition.

See the according drivers page for instructions.

Troubleshooting

Machine reboots after shutting down

Try removing ehci_hcd before shutting down, eg, add the following line to rc.local.shutdown

rmmod ehci_hcd

Needed on X220 and X230.

ThinkPads on which it is recommended to use ACPI