All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] thermal: rcar_{gen3_}thermal: Remove temperature
@ 2020-01-17 15:22 Niklas Söderlund
  2020-01-17 15:22 ` [PATCH v2 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
  2020-01-17 15:22 ` [PATCH v2 2/2] thermal: rcar_gen3_thermal: " Niklas Söderlund
  0 siblings, 2 replies; 4+ messages in thread
From: Niklas Söderlund @ 2020-01-17 15:22 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 v2 1/2] thermal: rcar_thermal: Remove temperature bound
  2020-01-17 15:22 [PATCH v2 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Niklas Söderlund
@ 2020-01-17 15:22 ` Niklas Söderlund
  2020-01-17 16:05   ` Niklas Söderlund
  2020-01-17 15:22 ` [PATCH v2 2/2] thermal: rcar_gen3_thermal: " Niklas Söderlund
  1 sibling, 1 reply; 4+ messages in thread
From: Niklas Söderlund @ 2020-01-17 15:22 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
- 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..f9c1fa10e6a2b3fd 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 ragne is -45C to 125C. */
 
 	*temp = tmp;
 
-- 
2.24.1


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

* [PATCH v2 2/2] thermal: rcar_gen3_thermal: Remove temperature bound
  2020-01-17 15:22 [PATCH v2 0/2] thermal: rcar_{gen3_}thermal: Remove temperature Niklas Söderlund
  2020-01-17 15:22 ` [PATCH v2 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
@ 2020-01-17 15:22 ` Niklas Söderlund
  1 sibling, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2020-01-17 15:22 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
- 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..ce06183a007780a2 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 ragne 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 v2 1/2] thermal: rcar_thermal: Remove temperature bound
  2020-01-17 15:22 ` [PATCH v2 1/2] thermal: rcar_thermal: Remove temperature bound Niklas Söderlund
@ 2020-01-17 16:05   ` Niklas Söderlund
  0 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

On 2020-01-17 16:22:41 +0100, Niklas Söderlund wrote:
> 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
> - 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..f9c1fa10e6a2b3fd 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 ragne is -45C to 125C. */

s/ragne/range/

A bit embarrassing, sometime my hands can't keep up... Will send v3.

>  
>  	*temp = tmp;
>  
> -- 
> 2.24.1
> 

-- 
Regards,
Niklas Söderlund

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

end of thread, other threads:[~2020-01-17 16:05 UTC | newest]

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

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.