Reported by Nikolaus Schaller, Sep 24, 2019
cat /sys/devices/virtual/thermal/thermal_zone0/temp seems to report the value from the previous measurement and not a current value. This has the strange effect that after boot or after longer time of idle, you get a value that may be more than 10°C apart from the next read. It is not clear if this is a bug in the bandgap ADC or in the driver or somewhere else because it is not seen on am335x or omap5. One indication is that we can see the effect also when using devmem2 to directly read the bandgap register (0x48002524). Some ideas are that the timeout in the driver which waits for SOC and EOCZ bits is too short and therefore reads too early. BTW: it is not clear how often the govenor reads the bandgap sensor for thermal management. If it does regularily it may hide this effect from the user. So tests should be run with bandgap based thermal management disabled.
Comment 1 by Nikolaus Schaller, Apr 10, 2020
Comment 2 by Nikolaus Schaller, Apr 10, 2020