@@ -642,8 +642,11 @@ distinct. The unmute the volume after the mute command, use either the
642642up or down command (the level command will not unmute the volume).
643643The current volume level and mute state is shown in the file.
644644
645- EXPERIMENTAL: fan speed, fan enable/disable -- /proc/acpi/ibm/fan
646- -----------------------------------------------------------------
645+ EXPERIMENTAL: fan speed, fan enable/disable
646+ -------------------------------------------
647+
648+ procfs: /proc/acpi/ibm/fan
649+ sysfs device attributes: (hwmon) fan_input, pwm1, pwm1_enable
647650
648651This feature is marked EXPERIMENTAL because the implementation
649652directly accesses hardware registers and may not work as expected. USE
@@ -656,27 +659,26 @@ from the hardware registers of the embedded controller. This is known
656659to work on later R, T and X series ThinkPads but may show a bogus
657660value on other models.
658661
659- Most ThinkPad fans work in "levels". Level 0 stops the fan. The higher
660- the level, the higher the fan speed, although adjacent levels often map
661- to the same fan speed. 7 is the highest level, where the fan reaches
662- the maximum recommended speed. Level "auto" means the EC changes the
663- fan level according to some internal algorithm, usually based on
664- readings from the thermal sensors. Level "disengaged" means the EC
665- disables the speed-locked closed-loop fan control, and drives the fan as
666- fast as it can go, which might exceed hardware limits, so use this level
667- with caution.
662+ Fan levels:
668663
669- The fan usually ramps up or down slowly from one speed to another,
670- and it is normal for the EC to take several seconds to react to fan
671- commands.
664+ Most ThinkPad fans work in "levels" at the firmware interface. Level 0
665+ stops the fan. The higher the level, the higher the fan speed, although
666+ adjacent levels often map to the same fan speed. 7 is the highest
667+ level, where the fan reaches the maximum recommended speed.
672668
673- The fan may be enabled or disabled with the following commands:
669+ Level "auto" means the EC changes the fan level according to some
670+ internal algorithm, usually based on readings from the thermal sensors.
674671
675- echo enable >/proc/acpi/ibm/fan
676- echo disable >/proc/acpi/ibm/fan
672+ There is also a "full-speed" level, also known as "disengaged" level.
673+ In this level, the EC disables the speed-locked closed-loop fan control,
674+ and drives the fan as fast as it can go, which might exceed hardware
675+ limits, so use this level with caution.
677676
678- Placing a fan on level 0 is the same as disabling it. Enabling a fan
679- will try to place it in a safe level if it is too slow or disabled.
677+ The fan usually ramps up or down slowly from one speed to another, and
678+ it is normal for the EC to take several seconds to react to fan
679+ commands. The full-speed level may take up to two minutes to ramp up to
680+ maximum speed, and in some ThinkPads, the tachometer readings go stale
681+ while the EC is transitioning to the full-speed level.
680682
681683WARNING WARNING WARNING: do not leave the fan disabled unless you are
682684monitoring all of the temperature sensor readings and you are ready to
@@ -694,48 +696,101 @@ fan is turned off when the CPU temperature drops to 49 degrees and the
694696HDD temperature drops to 41 degrees. These thresholds cannot
695697currently be controlled.
696698
699+ The ThinkPad's ACPI DSDT code will reprogram the fan on its own when
700+ certain conditions are met. It will override any fan programming done
701+ through thinkpad-acpi.
702+
703+ The thinkpad-acpi kernel driver can be programmed to revert the fan
704+ level to a safe setting if userspace does not issue one of the procfs
705+ fan commands: "enable", "disable", "level" or "watchdog", or if there
706+ are no writes to pwm1_enable (or to pwm1 *if and only if* pwm1_enable is
707+ set to 1, manual mode) within a configurable amount of time of up to
708+ 120 seconds. This functionality is called fan safety watchdog.
709+
710+ Note that the watchdog timer stops after it enables the fan. It will be
711+ rearmed again automatically (using the same interval) when one of the
712+ above mentioned fan commands is received. The fan watchdog is,
713+ therefore, not suitable to protect against fan mode changes made through
714+ means other than the "enable", "disable", and "level" procfs fan
715+ commands, or the hwmon fan control sysfs interface.
716+
717+ Procfs notes:
718+
719+ The fan may be enabled or disabled with the following commands:
720+
721+ echo enable >/proc/acpi/ibm/fan
722+ echo disable >/proc/acpi/ibm/fan
723+
724+ Placing a fan on level 0 is the same as disabling it. Enabling a fan
725+ will try to place it in a safe level if it is too slow or disabled.
726+
697727The fan level can be controlled with the command:
698728
699- echo 'level <level>' > /proc/acpi/ibm/thermal
729+ echo 'level <level>' > /proc/acpi/ibm/fan
700730
701- Where <level> is an integer from 0 to 7, or one of the words "auto"
702- or "disengaged" (without the quotes). Not all ThinkPads support the
703- "auto" and "disengaged" levels.
731+ Where <level> is an integer from 0 to 7, or one of the words "auto" or
732+ "full-speed" (without the quotes). Not all ThinkPads support the "auto"
733+ and "full-speed" levels. The driver accepts "disengaged" as an alias for
734+ "full-speed", and reports it as "disengaged" for backwards
735+ compatibility.
704736
705737On the X31 and X40 (and ONLY on those models), the fan speed can be
706- controlled to a certain degree. Once the fan is running, it can be
738+ controlled to a certain degree. Once the fan is running, it can be
707739forced to run faster or slower with the following command:
708740
709- echo 'speed <speed>' > /proc/acpi/ibm/thermal
741+ echo 'speed <speed>' > /proc/acpi/ibm/fan
710742
711- The sustainable range of fan speeds on the X40 appears to be from
712- about 3700 to about 7350. Values outside this range either do not have
713- any effect or the fan speed eventually settles somewhere in that
714- range. The fan cannot be stopped or started with this command.
743+ The sustainable range of fan speeds on the X40 appears to be from about
744+ 3700 to about 7350. Values outside this range either do not have any
745+ effect or the fan speed eventually settles somewhere in that range. The
746+ fan cannot be stopped or started with this command. This functionality
747+ is incomplete, and not available through the sysfs interface.
715748
716- The ThinkPad's ACPI DSDT code will reprogram the fan on its own when
717- certain conditions are met. It will override any fan programming done
718- through thinkpad-acpi.
749+ To program the safety watchdog, use the "watchdog" command.
750+
751+ echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan
752+
753+ If you want to disable the watchdog, use 0 as the interval.
754+
755+ Sysfs notes:
756+
757+ The sysfs interface follows the hwmon subsystem guidelines for the most
758+ part, and the exception is the fan safety watchdog.
759+
760+ hwmon device attribute pwm1_enable:
761+ 0: PWM offline (fan is set to full-speed mode)
762+ 1: Manual PWM control (use pwm1 to set fan level)
763+ 2: Hardware PWM control (EC "auto" mode)
764+ 3: reserved (Software PWM control, not implemented yet)
765+
766+ Modes 0 and 2 are not supported by all ThinkPads, and the driver
767+ is not always able to detect this. If it does know a mode is
768+ unsupported, it will return -EINVAL.
769+
770+ hwmon device attribute pwm1:
771+ Fan level, scaled from the firmware values of 0-7 to the hwmon
772+ scale of 0-255. 0 means fan stopped, 255 means highest normal
773+ speed (level 7).
774+
775+ This attribute only commands the fan if pmw1_enable is set to 1
776+ (manual PWM control).
777+
778+ hwmon device attribute fan1_input:
779+ Fan tachometer reading, in RPM. May go stale on certain
780+ ThinkPads while the EC transitions the PWM to offline mode,
781+ which can take up to two minutes. May return rubbish on older
782+ ThinkPads.
783+
784+ driver attribute fan_watchdog:
785+ Fan safety watchdog timer interval, in seconds. Minimum is
786+ 1 second, maximum is 120 seconds. 0 disables the watchdog.
787+
788+ To stop the fan: set pwm1 to zero, and pwm1_enable to 1.
789+
790+ To start the fan in a safe mode: set pwm1_enable to 2. If that fails
791+ with ENOTSUP, set it to 1 and set pwm1 to at least 128 (255 would be the
792+ safest choice, though).
719793
720- The thinkpad-acpi kernel driver can be programmed to revert the fan
721- level to a safe setting if userspace does not issue one of the fan
722- commands: "enable", "disable", "level" or "watchdog" within a
723- configurable ammount of time. To do this, use the "watchdog" command.
724-
725- echo 'watchdog <interval>' > /proc/acpi/ibm/fan
726-
727- Interval is the ammount of time in seconds to wait for one of the
728- above mentioned fan commands before reseting the fan level to a safe
729- one. If set to zero, the watchdog is disabled (default). When the
730- watchdog timer runs out, it does the exact equivalent of the "enable"
731- fan command.
732-
733- Note that the watchdog timer stops after it enables the fan. It will
734- be rearmed again automatically (using the same interval) when one of
735- the above mentioned fan commands is received. The fan watchdog is,
736- therefore, not suitable to protect against fan mode changes made
737- through means other than the "enable", "disable", and "level" fan
738- commands.
739794
740795EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan
741796---------------------------------------
0 commit comments