Logo
Overview
Control your fan's speed on thinkpad

Control your fan's speed on thinkpad

January 13, 2020
2 min read
index

Normally, you don’t need to manually control your fan’s speed as the hardware already do the job. Though somehow it doesn’t work as you expect. Like in my case, the temperature is too high while the fan doesn’t spin at all. Enough of me talking, let’s do this.

Warning (Warning)

This tutorial is solely for thinkpad, hence the title. Don’t point your finger at me if things go south.

Install thinkfan

For Arch and Arch-based distros:

First, you need to install yay:

Terminal window
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

Then simply install thinkfan on AUR with yay:

Terminal window
yay thinkfan

Other debian-based distros:

Terminal window
sudo apt-get -y install tp-smapi-dkms thinkfan lm-sensors read-edid i2c-tools

Or you can build it yourself:

Terminal window
git clone https://github.com/vmatare/thinkfan.git
cd thinkfan
mkdir build && cd build
ccmake ..
make
sudo make install

Check your fan

Terminal window
cat /proc/acpi/ibm/fan

It should show your level is on auto:

Terminal window
status: enabled
speed: 0
level: auto
commands: level <level> (<level> is 0-7, auto, disengaged, full-speed)
commands: enable, disable
commands: watchdog <timeout> (<timeout> is 0 (off), 1-120 (seconds))

Find your sensor location:

Terminal window
find /sys/devices -type f -name "temp*_input"

Take note of the output. This will be your hwmon location for thinkfan configuration file.

Configure

Now you can edit your thinkfan.conf using your preferred text editor:

Terminal window
sudo vim /etc/thinkfan.conf

Below is my setting. Put your hwmon location accordingly:

Terminal window
tp_fan /proc/acpi/ibm/fan
hwmon /sys/devices/virtual/thermal/thermal_zone0/temp
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input
(0, 0, 47)
(1, 45, 49)
(2, 47, 52)
(3, 50, 57)
(4, 55, 62)
(5, 60, 77)
(7, 73, 93)
(127, 85, 32767)

Configure thinkpad_acpi modprobe:

Terminal window
sudo echo "options thinkpad_acpi fan_control=1" | sudo tee /etc/modprobe.d/thinkfan.conf
sudo modprobe -rv thinkpad_acpi
sudo modprobe -v thinkpad_acpi
Note (Info)

If you encounter modprobe: FATAL: "Module thinkpad_acpi is in use” then just reboot your machine.

Now let’s start your thinkfan:

Terminal window
sudo thinkfan -q

Then try checking your fan again:

Terminal window
cat /proc/acpi/ibm/fan

Your level should be other than auto:

status: disabled
speed: 0
level: 0
commands: level <level> (<level> is 0-7, auto, disengaged, full-speed)
commands: enable, disable
commands: watchdog <timeout> (<timeout> is 0 (off), 1-120 (seconds))