3

I used to manually disable fan writing "level 0" to /proc/acpi/ibm/fan and fan stayed off. Recently I installed thinkfan, started it, then stopped, but manual disabling it stopped working after such actions. Why? What could have changed in the system to result in such change for the fan?

System restart reverses it back - echo level 0 | sudo tee /proc/acpi/ibm/fan works again, running and stopping thinkfan (even when fan has not started during run) messes up with writing to /proc/acpi/ibm/fan as before, modification time of /proc/acpi/ibm/fan stays with time of manual write, but output changes to "enabled".

Below is a reproducible example (at least for my downloaded Linux Mint 20.2. and my Thinkpad; I initially discovered it on another Thinkpad model). For some as of now non-understandable reason, thinkfan on liveUSB does not use systemd, but the result is the same: the fan starts in absence of the thinkfan process after being manually disabled; thinkfan is same version, 0.9.1 (as output from thinkfan -h).

  • I've made USB with Linux Mint 20.2.

  • I'm booting it with "persistent" flag on the vmlinuz line instead of "quiet splash"

  • I've run echo options thinkpad_acpi fan_control=1' | sudo tee -a /etc/modprobe.d/thinkpad_acpi.conf then rebooted

  • After reboot, I'm able to manually set fan speed by echo level 0 | sudo tee /proc/acpi/ibm/fan

  • I've installed apt-get install stress

  • Fan speed remains 0 (as for noise and cat /proc/acpi/ibm/fan) when I do stress -c 2 -t 100

  • I've installed apt-get install thinkfan, but even after reboot sudo systemctl status/enable/start thinkfan outputs Unit thinkfan.service not found

  • I've edited /etc/thinkfan.conf. to uncomment:
    tp_fan /proc/acpi/ibm/fan
    tp_thermal /proc/acpi/ibm/thermal (0, 10, 15, 2, 10, 5, 0, 3, 0, 3)

  • However, I'm able to start thinkfan: sudo thinkfan -n in non-daemon mode. Fan started to start when I run stress. I've ended that run, it wrote cleaning up and resetting fan control

  • After that I've started sudo thinkfan - Daemon PID: 2548, then kill 2548.

  • I might have started thinkfan a couple of times as above.

  • Now (there are no thinkfan processes seen in System Monitor), after I do echo level 0 | sudo tee /proc/acpi/ibm/fan, I can see cat /proc/acpi/ibm/fan: disabled, 0, 0, but after I do stress -c 2 -t 100 after about 10 seconds I start to hear fan noise and cat /proc/acpi/ibm/fan: enabled, 5578, auto.

  • By the way, /proc/acpi/ibm/thermal gives output of about 40 as the first number when idle and ~80 when stress starts (the other numbers stay the same).

Initial issue (just in case):

Started thinkfan after install by (as far as can recall) sudo systemctl enable thinkfan. Wanted to go manually temporary and tried stop, disable: sudo systemctl disable thinkfan, there is no process called thinkfan running, output of sudo systemctl status thinkfan:

● thinkfan.service - simple and lightweight fan control program
     Loaded: loaded (/lib/systemd/system/thinkfan.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-11-11 18:09:56 MSK; 2 days ago
   Main PID: 33742 (code=exited, status=1/FAILURE)

Nov 11 18:09:51 alex-ThinkPad-slim thinkfan[33742]: A sensor has vanished! Exiting since there's no safe way of handling this.
Nov 11 18:09:56 alex-ThinkPad-slim thinkfan[33742]: Cleaning up and resetting fan control.
Nov 11 18:09:56 alex-ThinkPad-slim systemd[1]: thinkfan.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 18:09:56 alex-ThinkPad-slim systemd[1]: thinkfan.service: Failed with result 'exit-code'.
Nov 12 05:32:53 alex-ThinkPad-slim systemd[1]: /lib/systemd/system/thinkfan.service:9: PIDFile= references a path below legacy directory /var/run/, updating /var/run/thinkfan.pid → /run/thinkfan.pid; please update the unit file accordingly.

However, fan starts by itself after being manually turned off -- why?

$ cat /proc/acpi/ibm/fan
status:     disabled

$ stress -c 2 -t 100

$ cat /proc/acpi/ibm/fan
status:     enabled
8
  • the motherboard may have a hardware override that prevents errant software from destroying the motherboard
    – jsotola
    Commented Nov 13, 2021 at 20:04
  • @jsotola, the point is that before thinkfan install writing level 0 disabled fan until restart/sleep events as far as I recall. There is a throttling feature against overheating. Commented Nov 14, 2021 at 3:46
  • @Nate, output IMO did not add much thinkfan.service loaded failed failed simple and lightweight fan control program Commented Nov 18, 2021 at 4:56
  • @Nate than the question is "what starts the fan?" Commented Nov 18, 2021 at 5:22
  • 1
    Aha! You were changing the question. I was confused earlier because when I looked back at the question, I thought I'd missed info. I think we were both adding at the same time. I was reading / responding to your Q in one monitor while programming in another. That is what I meant. My concentration was /is spread thin, so I thought I had looked over the last half of your question somehow. BTW, Ill probably delete these comments once you've seen them so as not to distract from the question. Sorry I couldn't help more.
    – Nate T
    Commented Nov 18, 2021 at 9:43

1 Answer 1

2

Ah, bounty wasted (maybe not if somebody will write a better, more comprehensive answer).

I've found in thinkfan (at least 0.9) code (as I've understood it) activation of watchdog for fan control. echo watchdog 0 | sudo tee /proc/acpi/ibm/fan disables it so needed in addition to echo disable | sudo tee /proc/acpi/ibm/fan to revert changes made by thinkfan.

https://www.kernel.org/doc/Documentation/admin-guide/laptops/thinkpad-acpi.rst:

The thinkpad-acpi kernel driver can be programmed to revert the fan level to a safe setting if userspace does not issue one of the procfs fan commands: "enable", "disable", "level" or "watchdog", or if there are no writes to pwm1_enable (or to pwm1 if and only if pwm1_enable is set to 1, manual mode) within a configurable amount of time of up to 120 seconds. This functionality is called fan safety watchdog.

Note that the watchdog timer stops after it enables the fan. It will be rearmed again automatically (using the same interval) when one of the above mentioned fan commands is received. The fan watchdog is, therefore, not suitable to protect against fan mode changes made through means other than the "enable", "disable", and "level" procfs fan commands, or the hwmon fan control sysfs interface.

To program the safety watchdog, use the "watchdog" command::

echo 'watchdog ' > /proc/acpi/ibm/fan

If you want to disable the watchdog, use 0 as the interval.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .