RSS Bot Posted May 3, 2023 Share Posted May 3, 2023 Description These patches fix an issue present on newer Kernels (6.1+, no idea if older kernels are affected as well), where the thermal sensors are unavailable (/sys/class/thermal is empty). By applying these patches, thermal sensors are available to use. The problem seems to be related by how Linux thermal driver drivers/thermal/thermal_of.c handles thermal zones without trips defined - if it doesn't exist, throw an error. I'm not Linux expert, but it looks like 6.1 brought some thermal driver refactoring, which might have caused this behavior. Before the patches, with logging verbosity set to 7, there's also an error present in boot log related to the sensor's init process: https://paste.armbian.com/awikixucez ... [ 1.255888] thermal_sys: Failed to find 'trips' node [ 1.255901] thermal_sys: Failed to find trip points for thermal-sensor id=0 [ 1.255916] sun8i-thermal 5070400.thermal-sensor: Failed to register sensor 0 (-EINVAL) [ 1.255925] sun8i-thermal: probe of 5070400.thermal-sensor failed with error -22 ... With the patches applied, the errors are no longer present: (sunxi-6.1 log): https://paste.armbian.com/jomezorune (sunxi-6.2 log): https://paste.armbian.com/kutozasuji Changes Added one trip to each thermal zone with missing trips (GPU, DDR & VE). Added critical trip point, set to 110C, corresponding to the recommended Tj max, as per H616 documentation (found here: https://linux-sunxi.org/H616) For completeness, added new critical trip point for CPU thermal zone, similar to trips mentioned above How Has This Been Tested? Both kernel versions have been compiled before and after applying patches and tested like this: Check if the board boots up Proceed with minimal initial setup Be logged in as root Check if sensors are available by using the following command: ls /sys/class/thermal/ Expected result: there are 4 directories present in the output Actual result (before patch): output is empty Check if sensors provide meaningful temperatures by using the following commands: cat /sys/class/thermal/thermal_zone0/temp cat /sys/class/thermal/thermal_zone1/temp cat /sys/class/thermal/thermal_zone2/temp cat /sys/class/thermal/thermal_zone3/temp Expected results: each sensor readout outputs sensible temperature (in my case, ~50 C) Actual result (before patch): no output, commands fail Checklist: [x] My code follows the style guidelines of this project [x] I have performed a self-review of my own code [ ] I have commented my code, particularly in hard-to-understand areas [ ] I have made corresponding changes to the documentation [x] My changes generate no new warnings [ ] Any dependent changes have been merged and published in downstream modules View the full article Link to comment Share on other sites More sharing options...
Recommended Posts