Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal: Do not log an error if thermal_zone_get_temp returns -EAGAIN

Some temperature sensors only get updated every few seconds and while
waiting for the first irq reporting a (new) temperature to happen there
get_temp operand will return -EAGAIN as it does not have any data to report
yet.

Not logging an error in this case avoids messages like these from showing
up in dmesg on affected systems:

[ 1.219353] thermal thermal_zone0: failed to read out thermal zone 0
[ 2.015433] thermal thermal_zone0: failed to read out thermal zone 0
[ 2.416737] thermal thermal_zone0: failed to read out thermal zone 0

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by

Hans de Goede and committed by
Eduardo Valentin
7e497a73 2771d000

+4 -2
+4 -2
drivers/thermal/thermal_core.c
··· 458 458 459 459 ret = thermal_zone_get_temp(tz, &temp); 460 460 if (ret) { 461 - dev_warn(&tz->device, "failed to read out thermal zone %d\n", 462 - tz->id); 461 + if (ret != -EAGAIN) 462 + dev_warn(&tz->device, 463 + "failed to read out thermal zone (%d)\n", 464 + ret); 463 465 return; 464 466 } 465 467