All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: Do not log an error if thermal_zone_get_temp returns -EAGAIN
Date: Sat, 7 Mar 2015 02:51:17 -0400	[thread overview]
Message-ID: <20150307065114.GA28318@developer> (raw)
In-Reply-To: <1426000006-15729-1-git-send-email-hdegoede@redhat.com>

Hans,

Thanks for fixing this. One minor request though.

On Tue, Mar 10, 2015 at 04:06:46PM +0100, Hans de Goede wrote:
> 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>
> ---
>  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 48491d1..e3cbf34 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",
> +				 tz->id);

Can you please take the opportunity to add the error code in the
message? Something like:
+			dev_warn(&tz->device,
+				 "failed to read out thermal zone (%d)\n",
+				 ret);

The thermal zone id (tz->id) is already included  in the error message
as it is always appended to the thermal zone device name
("thermal_zone%d", tz->id).


BR,

Eduardo Valentin

>  		return;
>  	}
>  
> -- 
> 2.3.1
> 

  reply	other threads:[~2015-03-10 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 15:06 [PATCH] thermal: Do not log an error if thermal_zone_get_temp returns -EAGAIN Hans de Goede
2015-03-07  6:51 ` Eduardo Valentin [this message]
2015-03-21 13:59   ` Hans de Goede
2015-03-10 16:05 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150307065114.GA28318@developer \
    --to=edubezval@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.