[ltp] Fan-problem-solution-proposal

Mario Limonciello linux-thinkpad@linux-thinkpad.org
Fri, 06 May 2005 00:24:02 -0400


Florian Dorpmueller wrote:

> For those who like to do something with their fan, I have writen a
> little script. You can use it as deamon or start it as local user
> (therefore you need to change the rights of /proc/acpi/ibm/fan).
>
> On my R51 this script reduces the fan usage remarkable. Under normal
> circumstances (20 degrees centigrade) I notice about 8 minutes fanless
> working and afterwards around 10 minutes cooling.
>
> Try and enjoy,
> Flori
>
> #!/bin/sh
> #
> # fan control-script
> #
> # based upon ibm-acpi 0.11
> #
> # eliminates anoying "fan always on" in battery mode
> # works with hysteresis (DELTA) so that always-turn-on/turn-off is
> avoided
> # fan acivates at MAXTEMP and cools down CPU, GPU etc. to
> MAXTEMP-DELTA than the fan is turned off
> # furthermore detects if AC is on and gives back fan control to
> default behaviour than
> #
> # one can change MAXTEMP and DELTA to individual values
> # but take care of your THINKPAD don`t melt it!
> #
> # have fun!
> # Flori 05.05.05
>
> MAXTEMP=50
> DELTA=4
>
> SWITCHTEMP=$MAXTEMP
>
> while [ 1 ];
> do
>   for ac in `sed s/state:// < /proc/acpi/ac_adapter/AC/state`
>     do
>      if [ "$ac" = "off-line" ]; then
>          fan=no
>          for temp in `sed s/temperatures:// < /proc/acpi/ibm/thermal`
>            do
>              test $temp -gt $SWITCHTEMP && fan=yes
>            done
>
>          if [ "$fan" = "yes" ]; then
>            command='enable'
>            SWITCHTEMP=`expr $MAXTEMP - $DELTA`
>          else
>            SWITCHTEMP=$MAXTEMP
>            command='disable'
>          fi
>
>        else # ac-adapter on -> set fan control to standard behaviour
>          command='enable'
>        fi
>
>        echo $command > /proc/acpi/ibm/fan
>        sleep 15
>      done
>   done
>
>
My only worry about using this script, is the temperatures on the GPU. 
When using fglrx driver and the thing running at top speed all the time,
I'm sure it gets toasty.
Elsewise, this was on my todo list that you just shrunk for me ;)