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.

For Arch and Arch-based distros:

First, you need to install yay:

Bash

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

Then simply install thinkfan on AUR with yay:

bash

yay thinkfan

Other debian-based distros:

bash

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

Or you can build it yourself:

bash

git clone https://github.com/vmatare/thinkfan.git

cd thinkfan

mkdir build && cd build

ccmake ..

make

sudo make install

bash

cat /proc/acpi/ibm/fan

It should show your level is on auto:

bash

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:

bash

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

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

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

bash

sudo vim /etc/thinkfan.conf

Below is my setting. Put your hwmon location accordingly:

bash

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:

bash

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:

bash

sudo thinkfan -q

Then try checking your fan again:

bash

cat /proc/acpi/ibm/fan

Your level should be other than auto:

text

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