Hi, I have spent some time trying to come up with a Colibri imx8x cooling fan control. I planned to use the Linux kernel thermal subsystem specified completely in the device tree. Unfortunately I ended up with a user-space controlling script instead. Here is a list of things I stumbled on. Not sure which of them are real issues. I would like to get a second opinion on my findings and maybe provide information for someone trying to do something similar.
- There are two sensors configured in the dts files
-
<&tsens IMX_SC_R_PMIC_0>
inpmic-thermal0
in imx8qxp-colibri.dtsi- always stuck at 70000, that is most likely a BUG
-
<&tsens 355>
incpu-thermal0
which corresponds toIMX_SC_R_SYSTEM
-
- None of the sensors can be used in multiple thermal zones. The second zone exists but trying to read the content of the
/sys/class/thermal/thermal_zoneX/temp
results in an error message “invalid argument” - The
IMX_SC_R_SYSTEM
sensor is handled by the kernel inimx_sc_thermal
as mentioned here: iMX8(X): Temperature trip points / Linux Thermal Management- the driver blindly assumes two trip points in a given order which obscures its behavior from the dts point of view
- the driver implements temperature trend retrieval
imx_sc_thermal_get_trend
which does not care about the temperature trend at all. It just checks a passive trip point returning either 0 orTHERMAL_TREND_RAISE_FULL
orTHERMAL_TREND_DROP_FULL
which confuses the default step_wise governor when additional trip points for active cooling are added.
Module: Colibri imx8x
Linux kernel: toradex_5.4-2.3.x-imx
Kind regards
Marek