All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Kukjin Kim <kgene@kernel.org>,
	linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Willy WOLFF <willy.mh.wolff@gmail.com>,
	Anand Moon <linux.amoon@gmail.com>
Subject: Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420
Date: Sat, 4 Mar 2017 10:01:09 +0200	[thread overview]
Message-ID: <20170304080109.j2kuwmqj7mgfx3ky@kozik-lap> (raw)
In-Reply-To: <252f9e32-ff2c-a1ce-3c98-6383a1148e02@osg.samsung.com>

On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
> Hello Krzysztof,
> 
> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> > In Odroid XU3 Lite board, the temperature levels reported for thermal
> > zone 0 were weird. In warm room:
> > 	/sys/class/thermal/thermal_zone0/temp:32000
> > 	/sys/class/thermal/thermal_zone1/temp:51000
> > 	/sys/class/thermal/thermal_zone2/temp:55000
> > 	/sys/class/thermal/thermal_zone3/temp:54000
> > 	/sys/class/thermal/thermal_zone4/temp:51000
> > 
> > Sometimes after booting the value was even equal to ambient temperature
> > which is highly unlikely to be a real temperature of sensor in SoC.
> > 
> > The thermal sensor's calibration (trimming) is based on fused values.
> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> > (corresponding to each TMU device).  However driver defined a minimum value
> > for fused data as 40 and for smaller values it was using a hard-coded 55
> > instead.  This lead to mapping data from sensor to wrong temperatures
> > for thermal zone 0.
> > 
> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> > do not impose any limits on fused values.  Since we do not have any
> > knowledge about these limits, use 0 as a minimum accepted fused value.
> > This should essentially allow accepting any reasonable fused value thus
> > behaving like vendor driver.
> > 
> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > 
> > ---
> > 
> > Testing on other Exynos542x boards is much appreciated. Especially I
> > wonder what efuse values are there.
> 
> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
> 
> The temperatures levels reported for these two boards on a warm room are:
> 
> Odroid XU4
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 50000
> 50000
> 54000
> 51000
> 48000
> 
> Peach Pi
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 42000
> 44000
> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
> 45000
> 45000
> 
> And the efuse values for the TMU devices are:
> 
> Odroid XU4
> 
> TMU0 = 45
> TMU1 = 44
> TMU2 = 44
> TMU3 = 46
> TMU3 = 46
> 
> Peach Pi
> 
> TMU0 = 44
> TMU1 = 46
> TMU2 = 36
> TMU3 = 53
> TMU3 = 46
> 
> The fused value for TMU2 is < 40 so that explains the weird temperature
> level for thermal zone 2 in Peach. So after your patch, makes more sense:
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 41000
> 42000
> 45000
> 43000
> 43000

Great! Thanks for testing!


> I wonder though if 0 is the best value or if we should just lower more
> to cover the used e-fuse values in Exynos5 boards. But as you said,
> we have no knowledge about these limits...

Yeah... we could set value of 10 or 20... but that would be blind shot.
> 
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 

Thanks,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-pm@vger.kernel.org, Anand Moon <linux.amoon@gmail.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-kernel@vger.kernel.org,
	Willy WOLFF <willy.mh.wolff@gmail.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Kukjin Kim <kgene@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420
Date: Sat, 4 Mar 2017 10:01:09 +0200	[thread overview]
Message-ID: <20170304080109.j2kuwmqj7mgfx3ky@kozik-lap> (raw)
In-Reply-To: <252f9e32-ff2c-a1ce-3c98-6383a1148e02@osg.samsung.com>

On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
> Hello Krzysztof,
> 
> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> > In Odroid XU3 Lite board, the temperature levels reported for thermal
> > zone 0 were weird. In warm room:
> > 	/sys/class/thermal/thermal_zone0/temp:32000
> > 	/sys/class/thermal/thermal_zone1/temp:51000
> > 	/sys/class/thermal/thermal_zone2/temp:55000
> > 	/sys/class/thermal/thermal_zone3/temp:54000
> > 	/sys/class/thermal/thermal_zone4/temp:51000
> > 
> > Sometimes after booting the value was even equal to ambient temperature
> > which is highly unlikely to be a real temperature of sensor in SoC.
> > 
> > The thermal sensor's calibration (trimming) is based on fused values.
> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> > (corresponding to each TMU device).  However driver defined a minimum value
> > for fused data as 40 and for smaller values it was using a hard-coded 55
> > instead.  This lead to mapping data from sensor to wrong temperatures
> > for thermal zone 0.
> > 
> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> > do not impose any limits on fused values.  Since we do not have any
> > knowledge about these limits, use 0 as a minimum accepted fused value.
> > This should essentially allow accepting any reasonable fused value thus
> > behaving like vendor driver.
> > 
> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > 
> > ---
> > 
> > Testing on other Exynos542x boards is much appreciated. Especially I
> > wonder what efuse values are there.
> 
> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
> 
> The temperatures levels reported for these two boards on a warm room are:
> 
> Odroid XU4
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 50000
> 50000
> 54000
> 51000
> 48000
> 
> Peach Pi
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 42000
> 44000
> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
> 45000
> 45000
> 
> And the efuse values for the TMU devices are:
> 
> Odroid XU4
> 
> TMU0 = 45
> TMU1 = 44
> TMU2 = 44
> TMU3 = 46
> TMU3 = 46
> 
> Peach Pi
> 
> TMU0 = 44
> TMU1 = 46
> TMU2 = 36
> TMU3 = 53
> TMU3 = 46
> 
> The fused value for TMU2 is < 40 so that explains the weird temperature
> level for thermal zone 2 in Peach. So after your patch, makes more sense:
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 41000
> 42000
> 45000
> 43000
> 43000

Great! Thanks for testing!


> I wonder though if 0 is the best value or if we should just lower more
> to cover the used e-fuse values in Exynos5 boards. But as you said,
> we have no knowledge about these limits...

Yeah... we could set value of 10 or 20... but that would be blind shot.
> 
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 

Thanks,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: krzk@kernel.org (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420
Date: Sat, 4 Mar 2017 10:01:09 +0200	[thread overview]
Message-ID: <20170304080109.j2kuwmqj7mgfx3ky@kozik-lap> (raw)
In-Reply-To: <252f9e32-ff2c-a1ce-3c98-6383a1148e02@osg.samsung.com>

On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
> Hello Krzysztof,
> 
> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> > In Odroid XU3 Lite board, the temperature levels reported for thermal
> > zone 0 were weird. In warm room:
> > 	/sys/class/thermal/thermal_zone0/temp:32000
> > 	/sys/class/thermal/thermal_zone1/temp:51000
> > 	/sys/class/thermal/thermal_zone2/temp:55000
> > 	/sys/class/thermal/thermal_zone3/temp:54000
> > 	/sys/class/thermal/thermal_zone4/temp:51000
> > 
> > Sometimes after booting the value was even equal to ambient temperature
> > which is highly unlikely to be a real temperature of sensor in SoC.
> > 
> > The thermal sensor's calibration (trimming) is based on fused values.
> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> > (corresponding to each TMU device).  However driver defined a minimum value
> > for fused data as 40 and for smaller values it was using a hard-coded 55
> > instead.  This lead to mapping data from sensor to wrong temperatures
> > for thermal zone 0.
> > 
> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> > do not impose any limits on fused values.  Since we do not have any
> > knowledge about these limits, use 0 as a minimum accepted fused value.
> > This should essentially allow accepting any reasonable fused value thus
> > behaving like vendor driver.
> > 
> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > 
> > ---
> > 
> > Testing on other Exynos542x boards is much appreciated. Especially I
> > wonder what efuse values are there.
> 
> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
> 
> The temperatures levels reported for these two boards on a warm room are:
> 
> Odroid XU4
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 50000
> 50000
> 54000
> 51000
> 48000
> 
> Peach Pi
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 42000
> 44000
> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
> 45000
> 45000
> 
> And the efuse values for the TMU devices are:
> 
> Odroid XU4
> 
> TMU0 = 45
> TMU1 = 44
> TMU2 = 44
> TMU3 = 46
> TMU3 = 46
> 
> Peach Pi
> 
> TMU0 = 44
> TMU1 = 46
> TMU2 = 36
> TMU3 = 53
> TMU3 = 46
> 
> The fused value for TMU2 is < 40 so that explains the weird temperature
> level for thermal zone 2 in Peach. So after your patch, makes more sense:
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 41000
> 42000
> 45000
> 43000
> 43000

Great! Thanks for testing!


> I wonder though if 0 is the best value or if we should just lower more
> to cover the used e-fuse values in Exynos5 boards. But as you said,
> we have no knowledge about these limits...

Yeah... we could set value of 10 or 20... but that would be blind shot.
> 
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 

Thanks,
Krzysztof

  reply	other threads:[~2017-03-04  8:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170211201512epcas2p2a49d26ddfbe2eaa6195927cbf01d48bb@epcas2p2.samsung.com>
2017-02-11 20:14 ` [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420 Krzysztof Kozlowski
2017-02-11 20:14   ` Krzysztof Kozlowski
2017-02-13 11:38   ` Anand Moon
2017-02-13 11:38     ` Anand Moon
2017-02-13 11:38     ` Anand Moon
2017-02-13 11:59     ` Krzysztof Kozlowski
2017-02-13 11:59       ` Krzysztof Kozlowski
2017-02-13 11:59       ` Krzysztof Kozlowski
2017-02-13 12:21       ` Anand Moon
2017-02-13 12:21         ` Anand Moon
2017-02-13 12:21         ` Anand Moon
2017-02-13 16:22   ` Bartlomiej Zolnierkiewicz
2017-02-13 16:22     ` Bartlomiej Zolnierkiewicz
2017-02-19  0:34   ` Eduardo Valentin
2017-02-19  0:34     ` Eduardo Valentin
2017-02-19  0:34     ` Eduardo Valentin
2017-03-03 21:50   ` Javier Martinez Canillas
2017-03-03 21:50     ` Javier Martinez Canillas
2017-03-03 21:50     ` Javier Martinez Canillas
2017-03-04  8:01     ` Krzysztof Kozlowski [this message]
2017-03-04  8:01       ` Krzysztof Kozlowski
2017-03-04  8:01       ` Krzysztof Kozlowski
2017-03-06  7:29       ` Anand Moon
2017-03-06  7:29         ` Anand Moon
2017-03-06  7:29         ` Anand Moon

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=20170304080109.j2kuwmqj7mgfx3ky@kozik-lap \
    --to=krzk@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=javier@osg.samsung.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=rui.zhang@intel.com \
    --cc=willy.mh.wolff@gmail.com \
    /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 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.