On 2020-08-26 07:40:46 +0000, Biju Das wrote:
Thanks for the feedback.
Subject: Re: [PATCH 4.19.y-cip 02/10] thermal: rcar_gen3_thermal: RemoveNiklas, Can you please clarify?
On Tue 2020-08-25 14:21:48, Biju Das wrote:
From: Niklas Söderlund <niklas.soderlund+renesas@...>I'm tempted to ask "how was this tested?" :-).
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.
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.
IIRC I was asked to remove the clamp as the hardware team had tested the
sensors in a wider range and it was judged better to report a reading
even if it was not guaranteed then to clamp it. I have not been able
myself to test this change myself and rely on the report from the
+++ b/drivers/thermal/rcar_gen3_thermal.c*devdata, int *temp)
@@ -182,9 +182,7 @@ static int rcar_gen3_thermal_get_temp(void
mcelsius = FIXPT_TO_MCELSIUS(val);
-/* Make sure we are inside specifications */
-if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125)))
+/* 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