# running way too hot and loosing battery fast

## zogle

i am a bit new to gentoo so please bare with me.

i am on a thinkpad x60  and this thing runs hot .. after 20~30 min uncomfortably so. =[. i thought, silly me i forgot to install power management "stuff" to dim the lcd, suspend on idle, throttle back the cpu.. etc. when trying to follow tutorials online. i have no luck. so here is a preview:

```
lspci

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)

00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)

00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)

02:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller

03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b4)

15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 09)

15:00.2 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 18)

```

```
lsmod

Module                  Size  Used by

i915                   16960  2 

drm                    53172  3 i915

ipv6                  185472  12 

arc4                    1248  2 

ecb                     2048  2 

blkcipher               3844  1 ecb

ieee80211_crypt_wep     3456  1 

rtc                     8760  0 

battery                 7588  0 

ipw3945               170564  1 

ieee80211              22888  1 ipw3945

ieee80211_crypt         2624  2 ieee80211_crypt_wep,ieee80211

firmware_class          6048  1 ipw3945

sdhci                  12716  0 

mmc_core               17316  1 sdhci

yenta_socket           18252  0 

rsrc_nonstatic          8448  1 yenta_socket

pcmcia_core            22964  2 yenta_socket,rsrc_nonstatic

i2c_i801                6128  0 

i2c_core               11296  1 i2c_i801

eth1394                14180  0 

pcspkr                  1856  0 

rng_core                3140  0 

intel_agp              16828  1 

agpgart                18772  3 drm,intel_agp

lpfc                  128840  0 

megaraid_sas           22096  0 

megaraid_mbox          24048  0 

megaraid_mm             7264  1 megaraid_mbox

aacraid                43744  0 

sx8                    13260  0 

DAC960                 58120  0 

cciss                  26628  0 

cpqarray               14948  0 

3w_9xxx                27684  0 

3w_xxxx                21536  0 

mptfc                  11044  0 

scsi_transport_fc      22020  2 lpfc,mptfc

mptspi                 12552  0 

mptscsih               13440  2 mptfc,mptspi

mptbase                40512  3 mptfc,mptspi,mptscsih

atp870u                25248  0 

dc395x                 26220  0 

sim710                  3076  0 

53c700                 21348  1 sim710

qla1280               111852  0 

dmx3191d                9440  0 

sym53c8xx              57684  0 

qlogicfas408            3680  0 

aha152x                28912  0 

aha1740                 6144  0 

BusLogic               59028  0 

aic7xxx               136312  0 

aic79xx               166008  0 

scsi_transport_spi     14432  7 mptspi,53c700,dmx3191d,sym53c8xx,aha152x,aic7xxx,aic79xx

sg                     22652  0 

tg3                    88580  0 

e1000                  91584  0 

nfs                    90720  0 

lockd                  44456  1 nfs

sunrpc                111164  2 nfs,lockd

jfs                   143436  0 

raid10                 18592  0 

raid1                  18112  0 

raid0                   6368  0 

dm_mirror              14964  0 

dm_mod                 36652  1 dm_mirror

ata_piix                9764  0 

ahci                   14212  2 

libata                 72880  2 ata_piix,ahci

sbp2                   16164  0 

ohci1394               27056  0 

ieee1394               57336  3 eth1394,sbp2,ohci1394

sl811_hcd               9120  0 

usbhid                 18560  0 

ohci_hcd               15556  0 

uhci_hcd               17708  0 

usb_storage            58048  0 

ehci_hcd               23340  0 

usbcore                84232  7 sl811_hcd,usbhid,ohci_hcd,uhci_hcd,usb_storage,ehci_hcd

```

pretty standard install. used "emerge gentoo-sources"

using gnome 2.16.3 &  kernel 2.6.21-r4

the power management applicatoin does not seem to list time remaining for my battery when the ac cord is unplugged. =[

the battery module is autoloaded on boot. (seen above)

**not sure if it helps but it should be noted i dont know how to get acpi to load on boot ?? i have to type "/etc/init.d/apcid start" each time =[**

[edit] silly me, a simple "rc-update add apcid default" would work[/edit]

i was trying to use cpudyn to "throttle back" my cpu when idling but trying to run that tells me i dont have apci or cpufreq supported in my kernel

```
 cpudynd -acpi -i 1 -t 60 -h /dev/sda

cpudynd version 0.99.0 Copyright: Ricardo Galli <gallir@uib.es>

We'll try acpi throttling support...

Kernel doesn't support ACPI throttling

cpudynd: CPU frequency control disabled

Error: Nothing to do, exiting

```

that would be all good and dandy except when i go back to my ".config" file those options are marked with a "y" or "m"  

any suggestions or any help would be greatly appreciated!!

thank you in advance.

[edit] started cpufreqd and rc-updating it lol. post my results soon enough [/edit]

----------

## mudrii

you should recomipe your Kernel with Power Management support 

You have too much modules loaded the system is not optimize at all.

What kernel are you using x86_64 or x86 ?

Post your

emerge --info

----------

## keenblade

If you use kde, you can use klaptopdaemon for easy power and battery management. It has a gui. Highly recommended.

----------

## bunder

word has it that fixing your dsdt can fix fan and battery issues on laptops... ymmv.

http://gentoo-wiki.com/HOWTO_Fix_Common_ACPI_Problems

----------

## zogle

here is my emerge --info

```

Portage 2.1.2.9 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.21-gentoo-r4 i686)

=================================================================

System uname: 2.6.21-gentoo-r4 i686 Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz

Gentoo Base System release 1.12.9

Timestamp of tree: Fri, 20 Jul 2007 18:30:01 +0000

dev-lang/python:     2.4.4-r4

dev-python/pycrypto: 2.0.1-r5

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.61

sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.17

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.23b

virtual/os-headers:  2.6.21

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i486-pc-linux-gnu"

CFLAGS="-O2 -mtune=i686 -pipe"

CHOST="i486-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"

CXXFLAGS="-O2 -mtune=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X Xorg acl aim alsa apache2 berkdb bitmap-fonts bluetooth bzlib cli cracklib crypt cups divx4linux dri encode etheral firefox flash fortran ftp gdbm glx gnome gpm gtk iconv icq ieee1394 imap ipv6 isdnlog jabbermozilla java jpeg libg++ midi mmx mp3 mpeg mudflap mysql ncurses nls nptl nptlonly opengl openmp oss pam pcre perl php png pppd python quicktime readline reflection samba session sms spl sse sse2 ssl svg svga tcpd thinkpad tiff truetype truetype-fonts type1-fonts unicode usb wifi win32codecs wma x86 xine xinerama xorg xv yahoo zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

----------

## obrut<-

hmm...

why do you use a i486 chost? it should work but i686 would be better.

go to /usr/src/linux, do a "make menuconfig" and select 

Power management options  ---> 

    CPU Frequency scaling  --->

        [*] CPU Frequency scaling                                        

        [*]   Enable CPUfreq debugging

        <*>   CPU frequency translation statistics

                  Default CPUFreq governor (userspace)  --->

        <M>   'performance' governor                                    

         ---   'userspace' governor for userspace frequency scaling

        <M>   'ondemand' cpufreq policy governor

        <M>   'conservative' cpufreq governor

         ---   CPUFreq processor drivers

        <M>   ACPI Processor P-States driver

after that you need to recompile and install your kernel and modules. i assume you use genkernel for building your kernel (because of the huge amount of useless modules) but i don't know how to do that with genkernel. i never used it. 

with those modules you won't need any further software to let your cpu lower it's clockspeed and voltage. you just have to put this into your /etc/conf.d/local.start:

echo ondemand >> /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo ondemand >> /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

----------

## zogle

thanks for the replay's and sorry it took so long to respond myself

you are correct i am using genkernel. every time i try to compile a kernel manually i can't boot? different problem haha.

```
genkernel -menuconfig all
```

thats how i edit the options

any recommendations on what modules i can get rid of?? thanks in advace

as of now i can't really be sure if your response is actually working? my laptop stil feels hot which makes me a little worried to let it sit there for an hour or so. i really don't need it to overheat. haha is there any way to see if this is working?

----------

## obrut<-

you can get rid of:

megaraid_sas           22096  0 

megaraid_mbox          24048  0 

megaraid_mm             7264  1 megaraid_mbox 

aacraid                43744  0 

sx8                    13260  0 

DAC960                 58120  0 

cciss                  26628  0 

cpqarray               14948  0 

3w_9xxx                27684  0 

3w_xxxx                21536  0 

atp870u                25248  0 

dc395x                 26220  0 

sim710                  3076  0 

53c700                 21348  1 sim710 

qla1280               111852  0 

dmx3191d                9440  0 

sym53c8xx              57684  0 

qlogicfas408            3680  0 

aha152x                28912  0 

aha1740                 6144  0 

BusLogic               59028  0 

aic7xxx               136312  0 

aic79xx               166008  0 

ohci_hcd               15556  0

perhaps there are a few more to get rid of but i'm not absolutely sure if they aren't in fact required.

it's always a good idea to compile the drivers for your hdd controller and root filesystem directly into the kernel image. in your case it's ahci, ataiixp, the root filesystem's driver. if you have those compiled directly into your kernel image you don't need genkernel. you must not compile the drivers for your harddisk controller and the filesystem you use on / as module! if you do so you won't be able to boot. you'll get  something like "kernel panic: not syncing. no root fs found!"

gl hf

----------

