[Letux-kernel] thermal madness

H. Nikolaus Schaller hns at goldelico.com
Fri Sep 13 21:51:40 CEST 2019


> Am 13.09.2019 um 21:44 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> Hi,
> 
> I was experimenting a bit a bit with the thermal:
> 
> fresh after rebooting and autoidling uarts and loading some modules I
> made the letux3704 device consume 32mA, so I expect the temperature to
> being low.

Indeed. I usually have the GTA04 up and running with X11 etc. so it is
significantly warmer.

> Reading the thermal gives this:
> 
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 58500
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 47000
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 47000
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 47000
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 47000
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 47000
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 48500
> root@(none):/# cat /sys/devices/virtual/thermal/thermal_zone0/temp 
> 48500
> 
> That is just the opposite to what Nikolaus was getting. Here it jumps
> down instead of up and stays stable.

Oops!!!

> My conclusion: the measurements are buffered somewhere/somehow and we
> are getting something old here. 

Or there is some other bug in the code...

I have tried to understand the code a little but it just reads some
registers... And translates ADC values to celsius.

And, there is some feature to handle temperature trends. This seems
to read multiple registers.

And in some case it may not be possible to read a value and then
it returns a previous one.

Hm. What if that situation is true for the first read? But the
previous is random?

Another test: I also did run the first cat command in a loop

for i in 1 2 3 4 5 6 7 8 9 10
do
	cat /sys/devices/virtual/thermal/thermal_zone0/temp
	sleep 0.1
done

This did show me a smooth transition from the first value to the
permanent values we see later...

BR,
Nikolaus



More information about the Letux-kernel mailing list