* [PATCH v2] thermal: Do not log an error if thermal_zone_get_temp returns -EAGAIN
@ 2015-03-21 14:02 Hans de Goede
0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2015-03-21 14:02 UTC (permalink / raw)
To: Zhang Rui, Eduardo Valentin; +Cc: linux-pm, Hans de Goede
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
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-log error code on thermal zone read error and stop logging the zone nr twice
---
drivers/thermal/thermal_core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 174d3bc..4108db7 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -458,8 +458,10 @@ static void update_temperature(struct thermal_zone_device *tz)
ret = thermal_zone_get_temp(tz, &temp);
if (ret) {
- dev_warn(&tz->device, "failed to read out thermal zone %d\n",
- tz->id);
+ if (ret != -EAGAIN)
+ dev_warn(&tz->device,
+ "failed to read out thermal zone (%d)\n",
+ ret);
return;
}
--
2.3.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-21 14:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-21 14:02 [PATCH v2] thermal: Do not log an error if thermal_zone_get_temp returns -EAGAIN Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).