All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature
@ 2020-01-17 16:05 Niklas Söderlund
  2020-01-17 16:05 ` [PATCH v3 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Niklas Söderlund @ 2020-01-17 16:05 UTC (permalink / raw)
  To: linux-pm, Wolfram Sang; +Cc: linux-renesas-soc, Niklas Söderlund

Hi,

This series removes the checks that the read out temperature are within
the guaranteed operation limits described in the hardware manual. It has
been discussed with the hardware guys and the judgement is that it's
better to report a best effort temperature instead of failing with -EIO

Niklas Söderlund (2):
  thermal: rcar_thermal: Remove temperature bound
  thermal: rcar_gen3_thermal: Remove temperature bound

 drivers/thermal/rcar_gen3_thermal.c | 4 +---
 drivers/thermal/rcar_thermal.c      | 7 +------
 2 files changed, 2 insertions(+), 9 deletions(-)

-- 
2.24.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/2] thermal: rcar_thermal: Remove temperature bound
  2020-01-17 16:05 [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Niklas Söderlund
@ 2020-01-17 16:05 ` Niklas Söderlund
  2020-01-17 16:05 ` [PATCH v3 2/2] thermal: rcar_gen3_thermal: " Niklas Söderlund
  2020-01-18 18:23 ` [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Daniel Lezcano
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2020-01-17 16:05 UTC (permalink / raw)
  To: linux-pm, Wolfram Sang; +Cc: linux-renesas-soc, Niklas Söderlund

The hardware manual states that the operation of the sensor is not
guaranteed outside the range of -45°C to 125°C, not that the readings
are invalid. Remove the bound check and try to deliver temperature
readings even if we are outside the guaranteed operation range.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- s/ragne/range/

* Changes since v1
- Preserver the guaranteed operating range in a comment.
---
 drivers/thermal/rcar_thermal.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index d0873de718da9218..49d351f77bf6e6fc 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -275,12 +275,7 @@ static int rcar_thermal_get_current_temp(struct rcar_thermal_priv *priv,
 		tmp = MCELSIUS((priv->ctemp * 5) - 60);
 	mutex_unlock(&priv->lock);
 
-	if ((tmp < MCELSIUS(-45)) || (tmp > MCELSIUS(125))) {
-		struct device *dev = rcar_priv_to_dev(priv);
-
-		dev_err(dev, "it couldn't measure temperature correctly\n");
-		return -EIO;
-	}
+	/* Guaranteed operating range is -45C to 125C. */
 
 	*temp = tmp;
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] thermal: rcar_gen3_thermal: Remove temperature bound
  2020-01-17 16:05 [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Niklas Söderlund
  2020-01-17 16:05 ` [PATCH v3 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
@ 2020-01-17 16:05 ` Niklas Söderlund
  2020-01-18 18:23 ` [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Daniel Lezcano
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2020-01-17 16:05 UTC (permalink / raw)
  To: linux-pm, Wolfram Sang; +Cc: linux-renesas-soc, Niklas Söderlund

The hardware manual states that the operation of the sensor is not
guaranteed with temperatures above 125°C, not that the readings are
invalid. Remove the bound check and try to deliver temperature readings
even if we are outside the guaranteed operation range.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- s/ragne/range/

* Changes since v1
- Preserve the guaranteed operating range in a comment.
---
 drivers/thermal/rcar_gen3_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index 1460cf9d9f1c397b..72877bdc072daaed 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -182,9 +182,7 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
 				tsc->coef.a2);
 	mcelsius = FIXPT_TO_MCELSIUS(val);
 
-	/* Make sure we are inside specifications */
-	if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125)))
-		return -EIO;
+	/* Guaranteed operating range is -40C to 125C. */
 
 	/* Round value to device granularity setting */
 	*temp = rcar_gen3_thermal_round(mcelsius);
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature
  2020-01-17 16:05 [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Niklas Söderlund
  2020-01-17 16:05 ` [PATCH v3 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
  2020-01-17 16:05 ` [PATCH v3 2/2] thermal: rcar_gen3_thermal: " Niklas Söderlund
@ 2020-01-18 18:23 ` Daniel Lezcano
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2020-01-18 18:23 UTC (permalink / raw)
  To: Niklas Söderlund, linux-pm, Wolfram Sang; +Cc: linux-renesas-soc

On 17/01/2020 17:05, Niklas Söderlund wrote:
> Hi,
> 
> This series removes the checks that the read out temperature are within
> the guaranteed operation limits described in the hardware manual. It has
> been discussed with the hardware guys and the judgement is that it's
> better to report a best effort temperature instead of failing with -EIO
> 
> Niklas Söderlund (2):
>   thermal: rcar_thermal: Remove temperature bound
>   thermal: rcar_gen3_thermal: Remove temperature bound
> 
>  drivers/thermal/rcar_gen3_thermal.c | 4 +---
>  drivers/thermal/rcar_thermal.c      | 7 +------
>  2 files changed, 2 insertions(+), 9 deletions(-)

Applied, thanks


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-18 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 16:05 [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Niklas Söderlund
2020-01-17 16:05 ` [PATCH v3 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
2020-01-17 16:05 ` [PATCH v3 2/2] thermal: rcar_gen3_thermal: " Niklas Söderlund
2020-01-18 18:23 ` [PATCH v3 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Daniel Lezcano

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.