Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp813424yba; Fri, 3 May 2019 10:52:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqBmxjKlVdDkM7yR6Lba/TLb/FyOalSTR6IttkSi1V0NDNz1ZH2LHV/XBAjXlnadnpN9Ea X-Received: by 2002:a63:368b:: with SMTP id d133mr12069431pga.7.1556905941979; Fri, 03 May 2019 10:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556905941; cv=none; d=google.com; s=arc-20160816; b=G00FEbSwgSUAYT0J7qB6dx5h/BU1K4+IBLDwwS4DOJICVefKVr/sadMb/AfQNe5LJ1 gVx5WUOULgC/nXJe2ujCGmBXqSOltv4eUrimLXPqI+Julqhh8Dlc+/cy9Bil0zDjocIy wvMZVDuZHrqlRZNfQ+GV9RJS67/dSumNMR5D9wgw3Ia0z+qKK6CnKOSF/PhPav/sr915 UTUaXHFwC5qx9w8a0lYI+STjQBUiOWiT0QH0GxGhnFjkrF6V9Ucv4NnKqJumjolBNz4p HcJ6WSXlWcNEdKZ1Dv/EqPiVPdvgMnNKY20d4KN/G0vq4wcjK29R9qIRTJXfEmsPiyVC oNRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=I6Kj7J5O6mOYwdObKv7gUJ8XCyM1RwJ3zMEkMb1FKIA=; b=ScQ+eo7NXQwXzr+4G5LRLRW5Ck/foW9+RttTJV+jmanuUroaVUxqL+CFXMCyr31V1Y 7+Rk/E3vE7RgoLGL0G9ZDyXQtah2Kq2YYe3Lxg4kn4GCtm7tLW9pcgJLUKYw8sIHJSB4 JaUnHXjRWoZDgcnT4eWx4td9+3UtBM5Rta0htNHGwWS1cMFArd3qtjCFhmgtRjuwW3RJ hpLdOGXrmxyprfia4CTViOA6dbvvvUSsTRp5yEHHn7yWg5XNgkrl8gMK4T6XWbaZXwG1 yajMGZnbxdaj1D6kuMw7UMniwCc5LSDYFRhIoywGUHr7pl9OUdY80iWRknZOsIDn1Deq LTKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CyQ4K5S6; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8si3045165pgs.0.2019.05.03.10.51.56; Fri, 03 May 2019 10:52:21 -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=@chromium.org header.s=google header.b=CyQ4K5S6; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728555AbfECQqz (ORCPT + 99 others); Fri, 3 May 2019 12:46:55 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41248 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728433AbfECQqy (ORCPT ); Fri, 3 May 2019 12:46:54 -0400 Received: by mail-pl1-f196.google.com with SMTP id d9so2954740pls.8 for ; Fri, 03 May 2019 09:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=I6Kj7J5O6mOYwdObKv7gUJ8XCyM1RwJ3zMEkMb1FKIA=; b=CyQ4K5S6LZCPez3P3h4Yxxkjx5MBxsP5BHCmBIL6WSY0qUlz3mMC4lIpY2Vhriry6a oXx9z7VzntcU6eC6xQcsSIzOqmACQmL8DeTBYaE8HymEL4qWrTlVSAmi/F6yKSegpaUY yzTiLzZgcSRyaY8DoLKKDvUdX+If3vo60mwTg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=I6Kj7J5O6mOYwdObKv7gUJ8XCyM1RwJ3zMEkMb1FKIA=; b=bzTKxfPedBMBILoKoO+IrHIE8g+RhmUr+//U2lYf5UwReAN5k8/GpEnNv9nWWUd71z FaJp1q8jDJ/NBPolmg4azyfD7oGndKkmUM18Ec4LPjfwj73XBB/WinmHe9yODbzhP/Tw lrp71+TdWcMkhcZpVRVDxG+5sswaONGyA0rYz1ZcljV72KJlaQuYsBotbPgDH5zDf+Mc B2LHXLh+C4L34xm9X/LsWJJpDN/kEIb4zcmj0Df7N525kRuCawBkbxHj1C0aBvQovUxI z+VwjFmzzdoCzNNZ3FEz67xBQPsQsCf+wGbuYx/vtnMYM+072Ej6DjAfu1pXWWnoVEsa ay5w== X-Gm-Message-State: APjAAAUsoogG9wwg0Fqkzg7PkN+AcJON1Zy/efAavzKwGo6OaHA06xjA yvIdBbfvpvBpNu3h0mnJu6OV6Q== X-Received: by 2002:a17:902:1c1:: with SMTP id b59mr11866780plb.182.1556902013175; Fri, 03 May 2019 09:46:53 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id f21sm3394538pfn.30.2019.05.03.09.46.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 09:46:52 -0700 (PDT) Date: Fri, 3 May 2019 09:46:51 -0700 From: Matthias Kaehlcke To: 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 , Daniel Lezcano , 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 Subject: Re: [PATCH 1/8] arm64: dts: mt8183: add thermal zone node Message-ID: <20190503164651.GB40515@google.com> References: <1556793795-25204-1-git-send-email-michael.kao@mediatek.com> <1556793795-25204-2-git-send-email-michael.kao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I'm not an expert in the matter though, just happend to look into this recently :) Cheers Matthias