devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	kgene@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com,
	catalin.marinas@arm.com, will.deacon@arm.com,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	krzk@kernel.org, jh80.chung@samsung.com, sw0312.kim@samsung.com,
	jy0922.shim@samsung.com, inki.dae@samsung.com,
	jonghwa3.lee@samsung.com, beomho.seo@samsung.com,
	jaewon02.kim@samsung.com, human.hwang@samsung.com,
	ideal.song@samsung.com, ingi2.kim@samsung.com,
	m.szyprowski@samsung.com, a.hajda@samsung.com,
	s.nawrocki@samsung.com, chanwoo@kernel.org
Subject: Re: [PATCH 5/7] arm64: dts: exynos: Add dts files for Samsung Exynos5433 64bit SoC
Date: Tue, 16 Aug 2016 19:51:49 +0200	[thread overview]
Message-ID: <20160816175149.GA14206@kozik-lap> (raw)
In-Reply-To: <57B30E2E.3090506@samsung.com>

On Tue, Aug 16, 2016 at 09:59:26PM +0900, Chanwoo Choi wrote:
> >> diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tmu.dtsi b/arch/arm64/boot/dts/exynos/exynos5433-tmu.dtsi
> >> new file mode 100644
> >> index 000000000000..175121db367e
> >> --- /dev/null
> >> +++ b/arch/arm64/boot/dts/exynos/exynos5433-tmu.dtsi
> >> @@ -0,0 +1,306 @@
> >> +/*
> >> + * Device tree sources for Exynos5433 thermal zone
> >> + *
> >> + * Copyright (c) 2016 Chanwoo Choi <cw00.choi@samsung.com>
> >> + *
> >> + * This program is free software; you can redistribute it and/or modify
> >> + * it under the terms of the GNU General Public License version 2 as
> >> + * published by the Free Software Foundation.
> >> + */
> >> +
> >> +#include <dt-bindings/thermal/thermal.h>
> >> +
> >> +/ {
> >> +thermal-zones {
> >> +	atlas0_thermal: atlas0-thermal {
> >> +		thermal-sensors = <&tmu_atlas0>;
> >> +		polling-delay-passive = <0>;
> >> +		polling-delay = <0>;
> >> +		trips {
> >> +			atlas0_alert_0: atlas0-alert-0 {
> >> +				temperature = <50000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> >> +			atlas0_alert_1: atlas0-alert-1 {
> >> +				temperature = <55000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> >> +			atlas0_alert_2: atlas0-alert-2 {
> >> +				temperature = <60000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> >> +			atlas0_alert_3: atlas0-alert-3 {
> >> +				temperature = <70000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> >> +			atlas0_alert_4: atlas0-alert-4 {
> >> +				temperature = <80000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> >> +			atlas0_alert_5: atlas0-alert-5 {
> >> +				temperature = <90000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> >> +			atlas0_alert_6: atlas0-alert-6 {
> >> +				temperature = <95000>;	/* millicelsius */
> >> +				hysteresis = <1000>;	/* millicelsius */
> >> +				type = "active";
> >> +			};
> > 
> > No critical trip? I think it might be useful to shutdown the system in a
> > user-friendly way.
> 
> When I use the critical trip, the following event occur[1].
> But, I guess that this temperature is not correct temperature
> because after completing the kernel booting, the temperature of big.LITTLE/G3D
> are normal when checking the /sys/class/thermal/thermal_zoneX/temp right after booting.
> - Maintain a uniform temperature(38 ~ 45 millicelsius) right after kernel booting.
> 
> I guess that the critical interrupt may occur before initializing the exynos tmu.
> But, I don't spend the many time to check the exynos-tmu.c driver.
> 
> [1]
> [  445.122122] thermal thermal_zone0: critical temperature reached(108 C),shutting down
> [  445.122399] exynos-tmu 10060000.tmu: Temperature sensor ID: 0xa
> [  445.122588] exynos-tmu 10060000.tmu: Calibration type is 2-point calibration
> [  445.127942] reboot: Failed to start orderly shutdown: forcing the issue
> [  445.134586] Emergency Sync complete
> [    1.097954] reboot: Power down

I understand. Apparently the exynos-tmu driver needs some fixes for
this race. Skipping critical then makes sense.

> 
> > 
> >> +		};
> >> +
> >> +		cooling-maps {
> >> +			map0 {
> >> +				/* Set maximum frequency as 1800MHz  */
> >> +				trip = <&atlas0_alert_0>;
> >> +				cooling-device = <&cpu4 1 1>;
> > 
> > Out of curiosity: why choosing specific cooling level (so quite fast
> > the device will slow down) instead of letting cooling framework to
> > decide how much to cool? Any particular reason behind this?
> 
> This cooling level is just default value in cooling-maps.
> This value is able to overwrite on dts file. 
> 
> And the thermal subsystem support the cpu cooling features
> with 'cooling-maps'.
> 
> Also, when I tested the performance and stress test
> with GLBenchmark, the temperature of big.LITTLE cores/G3D
> reach easily the critical temperature with 8 online cores.
> So, I add the cooling level aggressively to protect
> the system fault of CPU and GPU and to maintain
> the system state.

I was asking why you do not let cooling framework decide which cooling
level to use but instead you force a specific cooling level. Maybe code
will be a better example. Why not use:
			map0 {
				/* Set maximum frequency as 1800MHz  */
				trip = <&atlas0_alert_0>;
				cooling-device = <&cpu4 0 1>;
			}
			map1 {
				/* Set maximum frequency as 1700MHz  */
				trip = <&atlas0_alert_1>;
				cooling-device = <&cpu4 1 2>;
			};

For higher frequencies it makes even more sense:
			map6 {
				/* Set maximum frequency as 800MHz  */
				trip = <&atlas0_alert_6>;
				cooling-device = <&cpu4 7 11>;
			};

which allows the system to use suitable cooling level to maintain the
balance between performance and temperature dissipance, instead of some
fixed cooling level which might not be accurate to the system load.

Best regards,
Krzysztof

  reply	other threads:[~2016-08-16 17:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16  6:27 [PATCH 0/7] arm64: dts: Add the dts file for Exynos5433 and TM/TM2E board Chanwoo Choi
2016-08-16  6:27 ` [PATCH 1/7] clocksource: exynos_mct: Add the support for Exynos 64bit SoC Chanwoo Choi
2016-08-16  6:27 ` [PATCH 2/7] Documentation: bindings: Add Exynos5433 PMU compatible Chanwoo Choi
2016-08-16  7:40   ` Krzysztof Kozlowski
2016-08-16  8:08     ` Chanwoo Choi
2016-08-16  8:15       ` Krzysztof Kozlowski
2016-08-18 18:59   ` Rob Herring
     [not found] ` <1471328843-26653-1-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-16  6:27   ` [PATCH 3/7] cpufreq: dt: Add exynos5433 compatible to use generic cpufreq driver Chanwoo Choi
     [not found]     ` <1471328843-26653-4-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-16  7:47       ` Krzysztof Kozlowski
2016-08-16  8:49         ` Viresh Kumar
2016-08-16  6:35   ` [PATCH 5/7] arm64: dts: exynos: Add dts files for Samsung Exynos5433 64bit SoC Chanwoo Choi
     [not found]     ` <1471329328-26842-1-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-16 10:29       ` Krzysztof Kozlowski
2016-08-16 12:59         ` Chanwoo Choi
2016-08-16 17:51           ` Krzysztof Kozlowski [this message]
2016-08-17  0:46             ` Chanwoo Choi
2016-08-16 10:50     ` Sylwester Nawrocki
2016-08-16 13:02       ` Chanwoo Choi
2016-08-19 10:48     ` Marek Szyprowski
     [not found]       ` <b4bb1d48-ce1f-0ddf-9e96-3e2ad29bc3fa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-23  2:58         ` Chanwoo Choi
2016-08-16  6:35   ` [PATCH 7/7] arm64: dts: exynos: Add dts file for Exynos5433-based TM2E board Chanwoo Choi
2016-08-17  6:43     ` Krzysztof Kozlowski
2016-08-17  7:37       ` Chanwoo Choi
2016-08-18 19:10     ` Rob Herring
2016-08-16  6:27 ` [PATCH 4/7] pinctrl: samsung: Add GPFx support of Exynos5433 Chanwoo Choi
2016-08-16  6:42   ` Tomasz Figa
     [not found]   ` <1471328843-26653-5-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-16  8:46     ` Krzysztof Kozlowski
2016-08-18 19:00   ` Rob Herring
2016-08-19  9:07   ` Chanwoo Choi
2016-08-19 11:31     ` Tomasz Figa
     [not found]       ` <CA+Ln22EaUmdrfLXJfYPAtCQ1DY4Y5iLWr-tqG67-P9hSXKMC6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-24 12:53         ` Chanwoo Choi
2016-08-16  6:35 ` [PATCH 6/7] arm64: dts: exynos: Add dts file for Exynos5433-based TM2 board Chanwoo Choi
2016-08-17  6:42   ` Krzysztof Kozlowski
2016-08-17  7:36     ` Chanwoo Choi
2016-08-18 19:08   ` Rob Herring
2016-08-19  1:01     ` Chanwoo Choi
2016-08-19 17:05   ` Sylwester Nawrocki
2016-08-21  7:46     ` Chanwoo Choi

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=20160816175149.GA14206@kozik-lap \
    --to=k.kozlowski@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=beomho.seo@samsung.com \
    --cc=catalin.marinas@arm.com \
    --cc=chanwoo@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=human.hwang@samsung.com \
    --cc=ideal.song@samsung.com \
    --cc=ingi2.kim@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=jaewon02.kim@samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sw0312.kim@samsung.com \
    --cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).