Patch for controlling fan speed
When this patch is applied and the ibm-acpi module is loaded with the experimental=1 module parameter, the following new capabilities are added to /proc/acpi/ibm/fan:
# echo level LEVEL > /proc/acpi/ibm/fansets a fan speed level between 0 and 7, where LEVEL=0 means fan off and LEVEL=7 is the fastest speed.
# echo level auto > /proc/acpi/ibm/fantells the embedded controller to set the fan speed automatically according to system temperatures (this is the default).
# echo level disengaged > /proc/acpi/ibm/fantells the embedded controller to disengage fan speed control (see specs below).
# cat /proc/acpi/ibm/fanshows the current fan level (in addition to the fan speed in RPM).
#cat /proc/acpi/ibm/fan status: enabled level: auto speed: 4219 commands: enable, disable, level <level> (<level> is 0-7, auto or disengaged) #echo level 2 > /proc/acpi/ibm/fan #cat /proc/acpi/ibm/fan status: enabled level: 2 speed: 3142 commands: enable, disable, level <level> (<level> is 0-7, auto or disengaged)
This patch is best used with an ACPI fan control script that monitors system temperature and sets the fan speed accordingly.
for ibm-acpi 0.11
This also includes a minor fix (rename of device_add) to make ibm-acpi 0.11 compile on kernel 2.6.13.
for ibm-acpi 0.12a as found in kernel 2.6.14
A slightly modified version which also keeps the lines in the format expected by the gkrellm plugin.
(modified for kernel 2.6.17:)
Ideas for improvement
- When fan speed is controlled from userspace (e.g., by the ACPI fan control scripts), the userspace component may die (for whatever reason) leaving the fan at a low speed, potentially leading to damage. We can add a watchdog to the kernel component, which resets the fan to Embedded Controller control (leve: auto) if /proc/acpi/ibm/fan was not written to for N seconds.