Contents

Control your fan's speed on thinkpad

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
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:

1
2
3
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

Then simply install thinkfan on AUR with yay:

1
yay thinkfan

Other debian-based distros:

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

Or you can build it yourself:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
git clone https://github.com/vmatare/thinkfan.git

cd thinkfan

mkdir build && cd build

ccmake ..

make

sudo make install

Check your fan

1
cat /proc/acpi/ibm/fan

It should show your level is on auto:

1
2
3
4
5
6
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:

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

Take note 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:

1
sudo vim /etc/thinkfan.conf

Below is my setting. Put your hwmon location accordingly:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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:

1
2
3
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
Info
If you encounter modprobe: FATAL: "Module thinkpad_acpi is in use” then just reboot your machine.

Now let’s start your thinkfan:

1
sudo thinkfan -q

Then try checking your fan again:

1
cat /proc/acpi/ibm/fan

Your level should be other than auto:

1
2
3
4
5
6
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))