Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2305677yba; Mon, 6 May 2019 03:46:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUwIgJtLZzM/daBJHREXRU+ujP8PbgnTiXuRYs2Z0knMiKvyEi71/nQ9FWnh48gAQ68eS6 X-Received: by 2002:a65:5c8c:: with SMTP id a12mr31082244pgt.452.1557139560347; Mon, 06 May 2019 03:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557139560; cv=none; d=google.com; s=arc-20160816; b=B+wIz1B58X7RAa2jwrjAxzoNOTma85fgKuAUGbkZAyXMgncqU3AYNczALkD9I1TCc8 i+b6hRcwXE31coJnuDRGjKAWKVBjpogYAFFZCKPC0EkApWUtaZ9AaQ+g7o4n7gvvLWKQ e4IAFUGGxlGZJ9UX5ihv5OOsB2O4aswyUij4ymr7ppjpLLdIG7+O+ZTOeXct5jg0fLjY 1I6Y3D6G7lUXP/iTt+8jvWwn46A7Zc+GZ6JzN9OCBYA2Xk+/qWhT7J7QLm0rR1qObNw6 wDn5aB+jrbbBmQOp/CpDYnsdF30+6N8WWwFS30/AvhO7wJ2o475d2+Jl5sI7m6zzYS6K oJbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uCi++m+hmflAtTf0wEp9JT3iL7NhPW7odYvIK611ma4=; b=IhzYlPfslhSCISMHrKA3U2G9IfuYz+3R2FAlYAzRDiJSathMlK0l8L7zR4v6soflb7 3I9MXkaG8pDnZcL/fy8rnBk1CfZu6kq2g/c8X7LjjZXVakv+Y5bxEFs12UShBJMrb1IT 5GQOduLZWnPuFOrqYAXW3O+9crgeyxRtEXcq6c14s4HTyU9KHHP8vY41x+8+BSHX292Q aTaW0dGOdKZQOGHqi4JVScf/jEQyrffOARmn1+eqrisouPfEDZeSCLj+2okbhXHcsr0t SqEK/uiGu6P1H6pjqtWf5e3TOE6OghDKBukA88qrLAUG6ZJb+qWPYusuaD3u8WTYrLD6 blsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SZr/UgT/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si15500196ple.364.2019.05.06.03.45.44; Mon, 06 May 2019 03:46:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SZr/UgT/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726415AbfEFKnn (ORCPT + 99 others); Mon, 6 May 2019 06:43:43 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41663 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbfEFKnn (ORCPT ); Mon, 6 May 2019 06:43:43 -0400 Received: by mail-wr1-f67.google.com with SMTP id c12so16600969wrt.8 for ; Mon, 06 May 2019 03:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uCi++m+hmflAtTf0wEp9JT3iL7NhPW7odYvIK611ma4=; b=SZr/UgT/IQ9sh8lvU0B3M5ekEWd0V/Cm4RNDe4ul6z8F9ZavaeSx4eVJh/dWCzqJUo oTscLrrY/6XZpLJTGkh9fAhyvrWiEEUWqYTiUjvzy7RILfvJUyKjB1lUQdxuFEYiil7r nCRgmM4BL9sZ78L4/HF73e2hVRJEu3F3ab0ClPhoe37o6TOmB6DiBJXN8kcntvnM6pq4 gjSzS2FNGW7nUp5PX+fYaI5JzK7lhr7T8H89irVfl5xKre2OHu9snUmHscPcB8oaRGST UiXkA8lKGhXNOuprkmPEtZIzhKhsohMtE5PnGSV2mAwj8RYU58yVfGXg269G2yVol4UM YzLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uCi++m+hmflAtTf0wEp9JT3iL7NhPW7odYvIK611ma4=; b=TqPwCJvLSGn0kLHFtcL2Ju7hiCxtUKveU/+FouUYNievMvHzs+IpSV39cHYNkkZhos pwPqDyvdlA8alzRXmVXtSb7Cj/ZQaugu6JD3lo9KbBk9kYO4nTB4ePkNrm9Zbbba3aKl nILDbd/Y9JdXUf/TTxTqY70b72F6fj9RwLzFzPZbbve6+5l0njtuU9OgyvINg5eME0qy ODTfHOzcV+yJEuUL8hQ2DzCMQyuFgEOl5Yj2A/5byZ8HNoZRCFW1cJJXXd+xxMYHD2sh fLUslMXjFt5Ml1J4NYLQVy4YkMl98z+UKYCBvpIC/7pV50rKP3dllmf1suBvRb2vkARk SGzQ== X-Gm-Message-State: APjAAAXlxdNI/iCNOpE5fn0qMN/VCphrrf5pUpoFNdeGJsQaV0ytCOOQ UNLEpTnC4oMbHG79cD0vwjjapg== X-Received: by 2002:adf:ec0d:: with SMTP id x13mr17035465wrn.268.1557139421124; Mon, 06 May 2019 03:43:41 -0700 (PDT) Received: from [192.168.0.41] (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.googlemail.com with ESMTPSA id t18sm18987347wrg.19.2019.05.06.03.43.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 03:43:40 -0700 (PDT) Subject: Re: [PATCH 1/8] arm64: dts: mt8183: add thermal zone node To: Matthias Kaehlcke , Hsin-Yi Wang Cc: "michael.kao" , fan.chen@mediatek.com, jamesjj.liao@mediatek.com, dawei.chien@mediatek.com, louis.yu@mediatek.com, roger.lu@mediatek.com, Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , Matthias Brugger , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org References: <1556793795-25204-1-git-send-email-michael.kao@mediatek.com> <1556793795-25204-2-git-send-email-michael.kao@mediatek.com> <20190503164651.GB40515@google.com> From: Daniel Lezcano Message-ID: Date: Mon, 6 May 2019 12:43:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190503164651.GB40515@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05/2019 18:46, Matthias Kaehlcke wrote: > Hi, > > On Fri, May 03, 2019 at 04:03:58PM +0800, Hsin-Yi Wang wrote: >> On Thu, May 2, 2019 at 10:43 AM michael.kao wrote: >>> >>> Add thermal zone node to Mediatek MT8183 dts file. >>> >>> Signed-off-by: Michael Kao >>> --- >>> arch/arm64/boot/dts/mediatek/mt8183.dtsi | 64 ++++++++++++++++++++++++++++++++ >>> 1 file changed, 64 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi >>> index 926df75..b92116f 100644 >>> --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi >>> +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi >>> @@ -334,6 +334,67 @@ >>> status = "disabled"; >>> }; >>> >>> + thermal: thermal@1100b000 { >>> + #thermal-sensor-cells = <1>; >>> + compatible = "mediatek,mt8183-thermal"; >>> + reg = <0 0x1100b000 0 0x1000>; >>> + interrupts = <0 76 IRQ_TYPE_LEVEL_LOW>; >>> + clocks = <&infracfg CLK_INFRA_THERM>, >>> + <&infracfg CLK_INFRA_AUXADC>; >>> + clock-names = "therm", "auxadc"; >>> + resets = <&infracfg MT8183_INFRACFG_AO_THERM_SW_RST>; >>> + mediatek,auxadc = <&auxadc>; >>> + mediatek,apmixedsys = <&apmixedsys>; >>> + mediatek,hw-reset-temp = <117000>; >>> + nvmem-cells = <&thermal_calibration>; >>> + nvmem-cell-names = "calibration-data"; >>> + }; >>> + >>> + thermal-zones { >>> + cpu_thermal: cpu_thermal { >>> + polling-delay-passive = <1000>; >>> + polling-delay = <1000>; >>> + >>> + thermal-sensors = <&thermal 0>; >>> + sustainable-power = <1500>; >>> + }; >>> + >>> + tzts1: tzts1 { >>> + polling-delay-passive = <1000>; >>> + polling-delay = <1000>; >>> + thermal-sensors = <&thermal 1>; >> Is sustainable-power required for tzts? Though it's an optional >> property, kernel would have warning: >> [ 0.631556] thermal thermal_zone1: power_allocator: >> sustainable_power will be estimated >> [ 0.639586] thermal thermal_zone2: power_allocator: >> sustainable_power will be estimated >> [ 0.647611] thermal thermal_zone3: power_allocator: >> sustainable_power will be estimated >> [ 0.655635] thermal thermal_zone4: power_allocator: >> sustainable_power will be estimated >> [ 0.663658] thermal thermal_zone5: power_allocator: >> sustainable_power will be estimated >> if no sustainable-power assigned. > > The property is indeed optional, if it isn't specified IPA will use > the sum of the minimum power of all 'power actors' of the zone as > estimate (see estimate_sustainable_power()). This may lead to overly > agressive throttling, since the nominal sustainable power will always > be <= the requested power. > > In my understanding the sustainable power may varies between devices, > even for the same SoC. One could have all the hardware crammed into a > tiny plastic enclosure (e.g. ASUS Chromebit), another might have a > laptop form factor and a metal enclosure (e.g. ASUS C201). Both > examples are based on an Rockchip rk3288, but they have completely > different thermal behavior, and would likely have different values for > 'sustainable-power'. > > In this sense I tend to consider 'sustainable-power' more a device, > than a SoC property. You could specify a 'reasonable' value as a > starting point, but it will likely not be optimal for all or even most > devices. The warning might even be useful for device makers by > indicating them that there is room for tweaking. The sustainable power is the power dissipated by the devices belonging to the thermal zone at the given trip temperature. With the power numbers and the cooling devices, the IPA will change the states of the cooling devices to leverage the dissipated power to the sustainable power. The contribution is the cooling effect of the cooling device. However, the IPA is limited to one thermal zone and the cooling device is the cpu cooling device. There is the devfreq cooling device but as the graphic driver is not upstream, it is found in the android tree only for the moment. As you mentioned the sustainable power can vary depending on the form factor and the production process for the same SoC (they can go to higher frequencies thus dissipate more power). That is the reason why we split the DT per SoC and we override the values on a per SoC version basis. You can have a look the rk3399.dtsi and their variant for experimental board (*-rock960.dts) and the chromebook version (*-gru-kevin.dts). Do you want a empiric procedure to find out the sustainable power ? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog