Skip to content
Snippets Groups Projects
Neil Armstrong's avatar
Neil Armstrong authored
If the thermal core tries to update the temperature from an
uninitialized power supply, it will swawn the following warning:
thermal thermal_zoneXX: failed to read out thermal zone (-19)

But reading from an uninitialized power supply should not be
considered as a fatal error, but the thermal core expects
the -EAGAIN error to be returned in this particular case.

So convert -ENODEV as -EAGAIN to express the fact that reading
temperature from an uninitialized power supply shouldn't be
a fatal error, but should indicate to the thermal zone it should
retry later.

It notably removes such messages on Qualcomm platforms using the
qcom_battmgr driver spawning warnings until the aDSP firmware
gets up and the battery manager reports valid data.

Link: https://lore.kernel.org/all/2ed4c630-204a-4f80-a37f-f2ca838eb455@linaro.org/


Fixes: 5bc28b93 ("power_supply: power_supply_read_temp only if use_cnt > 0")
Fixes: 3be330bf ("power_supply: Register battery as a thermal zone")
Signed-off-by: Neil Armstrong's avatarNeil Armstrong <neil.armstrong@linaro.org>
1ebfa467
History
Name Last commit Last update