Fan override not persistent

I’ve flashed my Jetson AGX Xavier board with Jetpack 4.5 and then I’ve installed Linux 5.10 on top of it. Everything works flawlessly. Even the EVL Project works with extremely good results. Later on, I’ve noticed that fans do not run when under heavy load and it made the board quite hot. So after digging around in /sys I’ve found that /sys/devices/platform/fan/hwmon/hwmon2/pwm1 is the controller of the CPU fan.

However, I’m not sure how can I make the changes I do to this handle persistent. I believe after some amount of time or when the interrupt for this control fires it reverts back to default 0 value. I’ve expected a similar interface like Documentation/hwmon/nct6775 but it wasn’t present.

Can anybody enlighten me about this matter.
Thanks.

hello deniz343,

according to Jetson Linux | NVIDIA Developer, l4t-r32.5 is based-on kernel-4.9.

hello deniz343,

please refer to Maximizing Jetson Xavier Performance,
please have a try to maximize Jetson AGX Xavier series performance and fan speed with following command,
thanks
i.e. $ sudo /usr/bin/jetson_clocks --fan

Hi Jerry,

I’m aware that l4t-r32.5 is based on kernel-4.9, I’ve manually upgraded it to kernel-5.10.
And because of that jetson_clocks’s do_fan() method fails to find the correct /sys path for the fan control. I was actually wondering if it was possible to modify the DT to achieve this.

hello deniz343,

I haven’t moving to k-5.10 for verification, could you please check these hw monitors.
for example,

# sudo -i
# cat hwmon*/name
thermal-fan-est
pwm_tach
tegra_pwmfan
soctherm_oc

you’ll need to adjust PWM settings in the tegra_pwmfan nodes by setting target_pwm.
here’s PWM/RPM look-up table it’s used.

# cat pwm_rpm_table
(Index, RPM, PWM, RRU, RRD)
(0, 0, 0, 40, 40)
(1, 1000, 77, 2, 2)
(2, 2000, 120, 1, 1)
(3, 3000, 160, 1, 1)
(4, 4000, 255, 1, 1)
(5, 5000, 255, 1, 1)
(6, 6000, 255, 1, 1)
(7, 7000, 255, 1, 1)
(8, 10000, 255, 1, 1)
(9, 11000, 255, 1, 1)

Linux 5.10 reports the following

root@mech:/sys/class/hwmon# cat hwmon*/name
stmmac000
tmp451
pwmfan

root@mech:/sys/class/hwmon/hwmon2# ls -l
total 0
lrwxrwxrwx 1 root root    0 Şub 23 09:23 device -> ../../../fan
-r--r--r-- 1 root root 4096 Şub 23 09:23 name
lrwxrwxrwx 1 root root    0 Şub 23 09:23 of_node -> ../../../../../firmware/devicetree/base/fan
drwxr-xr-x 2 root root    0 Şub 23 09:23 power
-rw-r--r-- 1 root root 4096 Şub 23 09:24 pwm1
lrwxrwxrwx 1 root root    0 Şub 23 09:23 subsystem -> ../../../../../class/hwmon
-rw-r--r-- 1 root root 4096 Şub 23 09:20 uevent

hello deniz343,

it is the driver to control the fan by pwm,
i.e. $L4T_Sources/r32.5/Linux_for_Tegra/source/public/kernel/nvidia/drivers/thermal/pwm_fan.c

you may also looking into kernel documentation for the PWM fan property settings,
i.e. $L4T_Sources/r32.5/Linux_for_Tegra/source/public/kernel/nvidia/Documentation/devicetree/bindings/thermal/tegra-pwm-fan.txt

Okay thank you, I’ll try to build it out-of-tree. Other than that, currently executing following command repeatedly for 3-4 times seems to be keeping the fan running until reboot.

echo 255 > /sys/class/hwmon/hwmon2/pwm1

hello deniz343,

please also refer to Thermal Specifications, it should be throttling to force shutdown the system.
thanks

So if I understand correctly, I should definitely compile the $L4T_Sources/r32.5/Linux_for_Tegra/source/public/kernel/nvidia/drivers/thermal directory along with the kernel-5.10 build.

Would there be any safety concerns if I keep the fan on all the time?

EDIT: There is an opiton in Linux kernel config CONFIG_TEGRA_SOCTHERM. Would this be enough for theremal safety of the board?

hello deniz343,

CONFIG_TEGRA_SOCTHERM is by default enabled.
you may also refer to Jetson AGX Xavier Series Thermal Design Guide for the recommended operating temperature limit.
thanks

It wasn’t enabled on 5.10 defconfig. Anyway, I’ve enabled it on my end. Thank you for your support.