IBM X201 Fan control 'disangager'

 · Jean Schurger

I'm the lucky owner of a Thinkpad X201 since several years.

For some reason, (buggy firmware, dust, buddy drivers), the fan managment is very debious, especialy when your CPU reach high temperatures.

It's really disapointing to get the 'critical temperature reached(100 C),shutting down' message and see the system doing so.

Here is a very stupid script that force the fan to rotate at full speed if the CPU exceed 90°C and go back to automatic control when it cool down.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from time import sleep

# Set the fan control to 'disengaged' (full-speed) when the CPU temp exceed 90°C
# because the 'auto' mode doesn't allow the fan to reach its top speed when it is needed.

# The 'thinkpad_acpi' kernel module have to be configured to allow fan control
# using the fan_control=1 option.

while True:
    temp = int(open("/proc/acpi/ibm/thermal").read().split('\t')[1].split()[0])
    level = temp > 90 and 'disengaged' or 'auto'
    open("/proc/acpi/ibm/fan", "w").write("level %s" % level)