Re: [PATCH 4.19.y-cip 02/10] thermal: rcar_gen3_thermal: Remove temperature bound


Biju Das <biju.das.jz@...>
 

Hi Pavel,

Thanks for the feedback.

Subject: Re: [PATCH 4.19.y-cip 02/10] thermal: rcar_gen3_thermal: Remove
temperature bound

On Tue 2020-08-25 14:21:48, Biju Das wrote:
From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

commit 0f510a2457cbbba18a98492bab1bf540be57ebd1 upstream.

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.
I'm tempted to ask "how was this tested?" :-).

Sometimes sensors have glitches producing very high values in normal
temperatures, and it such case clamping can be useful, but I'll assume your
sensor works ok.
Niklas, Can you please clarify?

Cheers,
Biju




+++ 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);
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647

Join cip-dev@lists.cip-project.org to automatically receive all group messages.