SDB:ThinkPadPowerDrain

From openSUSE


Contents

Symptom

Many IBM/Lenovo ThinkPad laptops consume too much power in sleep (suspend-to-RAM) mode. The battery may only last for a few hours.

Cause

The major cause is the Radeon graphics chip used in some models. This does not get shut down properly by the ACPI system. It typically consumes 5W.

Another cause is the E1000 ethernet chip: by default this does not get shut down in sleep mode so that it can listen for wake-on-lan packets. This consumes about 0.3W

Solution

Loading a recent version of the radeonfb framebuffer driver should reduce the sleep-mode power consumption by about 4W. The basic process is described on [ThinkWiki]. This page tells you how to apply the process to openSuSE 10.2. Fixing earlier versions of SuSE is harder as you would have to patch the kernel source code and re-build it.

Before starting

To find out whether you have this problem:

  • Download the [power drain test script] from ThinkWiki.
  • Inspect the script to make sure that you trust it.
  • Disconnect the AC power.
  • Become "root" and run the test script. It will put the machine into sleep mode.
  • Leave the machine in sleep mode for a few minutes (at least 5, but 20 or more gives more accurate results).
  • Restart the machine using the power button.
  • Look at the file /var/log/battery.log - if the "result" line shows more than about 1500mW then your machine probably has this problem.

Radeon graphics chip

It is necessary to load the "radeonfb" driver during the boot process as recent versions of this driver have a workaround for the power problem. The workaround was added to the mainstream Linux kernel at version 2.6.18 so this fix requires "openSuSE 10.2" or above.

The normal openSuSE boot process loads the vesa driver which conflicts with the radeonfb driver, so it is necessary to change the boot parameters. A side-effect of doing this is that the bootsplash will not appear (this is the image that usually covers up the detailed boot messages).

  • Make sure that your machine is running openSuSE 10.2 or above, and that all kernel updates have been installed. If you do install an update at this stage, reboot the machine before continuing.
  • Become root by using su in a terminal window or by logging in as root on a command-line virtual console.
  • Edit /etc/sysconfig/kernel and add 'radeonfb' to the INITRD_MODULES line. It will probably look something like this:
INITRD_MODULES="processor thermal piix fan jbd ext3 edd radeonfb"
  • Make a new initrd (replace the numbers with your kernel version):
cd /boot
mkinitrd -i /boot/initrd-2.6.18.2-34-special -k vmlinux-2.6.18.2-34-default.gz
  • Edit /boot/grub/menu.lst
    • Copy the default boot stanza and put the new copy at the top of the list.
    • Give it a new title, and change the kernel line:
remove  vga=0x314 (or any other vga= parameter)
add     video=vesa:off vga=normal
    • Change the initrd line: replace '-default' with '-special'
    • The file should now look something like this:
# Modified by YaST2. Last modification on Fri Jan  5 11:20:56 UTC 2007
default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate

title openSUSE 10.2 with radeonfb fix
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.18.2-34-default root=/dev/hda2 video=vesa:off vga=normal    resume=/dev/hda1 splash=silent showopts
    initrd /boot/initrd-2.6.18.2-34-special

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 10.2
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.18.2-34-default root=/dev/hda2 vga=0x314    resume=/dev/hda1 splash=silent showopts
    initrd /boot/initrd-2.6.18.2-34-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 10.2
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.18.2-34-default root=/dev/hda2 vga=normal showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off 3
    initrd /boot/initrd-2.6.18.2-34-default


Ethernet chip

Edit /etc/init.d/boot.local and add the line:

/usr/sbin/ethtool -s eth0 wol d

This disables wake-on-lan and thus allows the ethernet chip to power off during ACPI sleep.

Test again

  • Reboot the machine. There should now be three options on the boot menu: make sure that it uses your new one.
  • Login and re-run the power-drain test. You should see a result under 1000mW. (An R51 with 1.5GB of RAM uses about 750mW in sleep mode)

If this does not fix the problem, look at the bootup messages:

dmesg | less

Search for lines starting "radeon" and see whether they give any clues. In particular you want to see one looking like this:

radeonfb: IBM Thinkpad R50/R51/T40/T41 detected, enabling workaround

Watch for kernel updates

Whenever an updated kernel is installed, you will have to make a new initrd and edit the boot menu again.


Links

[ThinkWiki page describing the problem in more detail]

[Power drain test script]