My laptop (Lenovo C940) has well documented problems [1] with thermal shutdowns: for issues beyond me, it freaks out thinking that it’s overheating, and does thermal shutdowns around 60 Celcius. (usually happens a few minutes into playing any game) 5.12 kernel is supposed to help [1,2], but until then I want to set /sys/class/thermal/thermal_zone/mode* to disabled. I can easily do this with the following command:
echo “disabled” | sudo tee /sys/class/thermal/thermal_zone*/mode
This fixes my thermal shutdown issues very nicely when used in combination with latest version of thermald. In order to persist this value, I tried adding it to the superuser crontab. Unfortunately it did not help:
That can be made with udev rules… i explain it on my machine…
I run
udevadm info -a /sys/class/thermal/thermal_zone0/
and get
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/virtual/thermal/thermal_zone0':
KERNEL=="thermal_zone0"
SUBSYSTEM=="thermal"
DRIVER==""
ATTR{available_policies}=="power_allocator user_space step_wise bang_bang fair_share "
ATTR{cdev0_trip_point}=="2"
ATTR{cdev0_weight}=="0"
ATTR{cdev1_trip_point}=="2"
ATTR{cdev1_weight}=="0"
ATTR{mode}=="enabled"
ATTR{policy}=="step_wise"
ATTR{power/async}=="disabled"
ATTR{power/control}=="auto"
ATTR{power/runtime_active_kids}=="0"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_enabled}=="disabled"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
ATTR{power/runtime_usage}=="0"
ATTR{temp}=="36000"
ATTR{trip_point_0_temp}=="90000"
ATTR{trip_point_0_type}=="critical"
ATTR{trip_point_1_temp}=="85000"
ATTR{trip_point_1_type}=="hot"
ATTR{trip_point_2_temp}=="85000"
ATTR{trip_point_2_type}=="passive"
ATTR{type}=="acpitz"
Now i create a file in /etc/udev/rules.d/ lets say 10-thermalmode.rules: