public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Lars Povlsen <lars.povlsen@microchip.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	linux-hwmon@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: sparx5: Fix initial reading of temperature
Date: Fri, 4 Sep 2020 09:40:48 -0700	[thread overview]
Message-ID: <20200904164048.GA74175@roeck-us.net> (raw)
In-Reply-To: <20200903134704.8949-1-lars.povlsen@microchip.com>

On Thu, Sep 03, 2020 at 03:47:04PM +0200, Lars Povlsen wrote:
> If the temperature is read before the internal calibration is
> completed, the driver returns -EIO. Instead it should return -EAGAIN
> to encourage repeating the operation.
> 
> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>

Applied. I added a note stating that I would prefer -ENODATA, and why,
but that this is not feasible due to thermal subsystem requirements. 

Thanks,
Guenter

> ---
>  drivers/hwmon/sparx5-temp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --
> 2.27.0
> 
> diff --git a/drivers/hwmon/sparx5-temp.c b/drivers/hwmon/sparx5-temp.c
> index 1a2b1026b026..98be48e3a22a 100644
> --- a/drivers/hwmon/sparx5-temp.c
> +++ b/drivers/hwmon/sparx5-temp.c
> @@ -56,7 +56,7 @@ static int s5_read(struct device *dev, enum hwmon_sensor_types type,
>  	case hwmon_temp_input:
>  		stat = readl_relaxed(hwmon->base + TEMP_STAT);
>  		if (!(stat & TEMP_STAT_VALID))
> -			return -EIO;
> +			return -EAGAIN;
>  		value = stat & TEMP_STAT_TEMP;
>  		/*
>  		 * From register documentation:

      parent reply	other threads:[~2020-09-04 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 13:47 [PATCH] hwmon: sparx5: Fix initial reading of temperature Lars Povlsen
2020-09-03 13:52 ` Guenter Roeck
2020-09-04  8:33   ` Lars Povlsen
2020-09-04 14:08     ` Guenter Roeck
2020-09-04 16:40 ` Guenter Roeck [this message]

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=20200904164048.GA74175@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=jdelvare@suse.com \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox