Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1484572pxu; Thu, 17 Dec 2020 11:02:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxv40rLoVSdZrN0Fk7/efcgvnuFYIWj/BNBXMI+EtWR8dbSie9KhWrz2U/mQyj404oR5AXI X-Received: by 2002:a17:906:2ec3:: with SMTP id s3mr411974eji.133.1608231755952; Thu, 17 Dec 2020 11:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608231755; cv=none; d=google.com; s=arc-20160816; b=kqgtEaanXicDeb4EIz2aVM0W7HAGlVjVoB3xoHROVKuWQOVBPQNua5Zy76qPfnEs5Y D88h6D0KBzG1KpGjmpm+9kfGZybAxFzxUdgTS2eiJnU/PvLxRG3zqUgjjt5nmQsLRsnl BuP+ZEW9J3otF/15WOzz7INu7YBAZmPEQw3Hem4xsXttsvc7u1aJ+Z9n6HIC5lbURgd3 adDI031sej/pAB9W3mJ9LivII96wuSr0HHuUUfxI0rkgvZmg8FynnC5al7VYjUhms4zF 98Y6CMEnzktEaDW1VQQttIvHEjCEsPxNon/pcDWObp4afuUph3tfYf0zI0d3VFi/AvIh 5puA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=81D+yHFMAabVlf+2tjVOZShdc9YBbXvn/2mHiBk65M8=; b=efP9rdERmQigfonUyUXSAKNavWcdTYProfcXYpj9Agb7b7gWf+mshbtk9/wwmQStFf G31TpKtJcq0NpIhsHGl6F2Cnjtx0IGhrGg/UK3BakN3kT7s9rXwH+WzwTdIGPDtj+DTJ dMsRNNjMSJB0b3GJ4C7cC10sXlSMy9Sk7X9ZEbvaBEhLhHd6N7ggWcTawq7BEJ5VwqIq j90ZEC1RQf0gUowTwLyP3sFoaWlQ6ElGD8oap1/CkQxmSq+q8poDR8aPj21tkR/q/cjg pU/NfrMW0BGqIQUwEsLxIqL2HKgjw8Z+lOie/1nrkPX20mHE9yygmwJerugmptC3myf+ unBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E4VCRRwg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si3584537eju.355.2020.12.17.11.02.12; Thu, 17 Dec 2020 11:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E4VCRRwg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730688AbgLQTBq (ORCPT + 99 others); Thu, 17 Dec 2020 14:01:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728194AbgLQTBq (ORCPT ); Thu, 17 Dec 2020 14:01:46 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E92BC061794; Thu, 17 Dec 2020 11:01:05 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id y19so60198732lfa.13; Thu, 17 Dec 2020 11:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=81D+yHFMAabVlf+2tjVOZShdc9YBbXvn/2mHiBk65M8=; b=E4VCRRwgR/wwwJZ3vV67dTB9C325unQ0kkUOLNhfK3cB9Coik2iK9XFK1Mkl7Li7BV ljYTYh7ccCTr9J8kDePLB/tKR1Ax6UPYyQdMOfo9OtZ/RY/xHNsoRGtTqVGNhEX7lu9m t8h7XcmH+TqCHlqiQE0P/LB3C6qNwDVQ322flLSUavE6ycdJkAibg+I4vgFqgparDlys h7QAlaLgGU+0khcKtaPcZ0Q76U+UZCdJqQ1x4yDKGxpdTxxLf+bBwkyphA0AgxakdYTO m3wAoVXRlQtyAVWMhNILnhc1J6IakGhyInFhMSoa9IuwTqk4krYzDREl8VrcPFk8ZRZS A7cQ== 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=81D+yHFMAabVlf+2tjVOZShdc9YBbXvn/2mHiBk65M8=; b=KsITVzItEO6a+NLQigAk5GKp0Vp5Hj6moc7VMuGPds32jT/e7wlUxmLifLwNUlNYt7 whaPNansaEPv4zJIwepjCldJOtOKDaW+1MrFV5fB3XwZKRs9MiwcObXkygvKcrQzdMZP Uv3m0IUZtvQgdcXvO9Q8U5o1JeuEQpH4plmWxx4cUi40AEQKUBOiqCSPA45rjKgEEfXa wmcn0JWcnBs+5Lu5bnRDp8ZKS1BfvYjzjk+fv+f74+rKBnrdfgeOvwuW3CE4QrMt3nIc iO9TfdvM65DH2CPKMc6BpQGAM05G1g4ZmfOp9JA3epv2ndy9OvYtfGd4TOX9N5P2Ii1M xj5Q== X-Gm-Message-State: AOAM5312h74r4ogfPJzv6wTp04zCYtaQrFGC0HnKKmlJ5uFqNl4qOF2/ KsrCCEeBP+TnmxAKA/EXT0iS4cuNDP4= X-Received: by 2002:a2e:4c11:: with SMTP id z17mr323589lja.364.1608231663452; Thu, 17 Dec 2020 11:01:03 -0800 (PST) Received: from [192.168.2.145] (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.googlemail.com with ESMTPSA id l1sm671498lfk.201.2020.12.17.11.01.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Dec 2020 11:01:02 -0800 (PST) Subject: Re: [PATCH v2 47/48] ARM: tegra: ventana: Support CPU voltage scaling and thermal throttling To: Daniel Lezcano , Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-48-digetx@gmail.com> <91139f8b-0b83-dd8a-ba53-8e7a499e6344@linaro.org> From: Dmitry Osipenko Message-ID: Date: Thu, 17 Dec 2020 22:01:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 In-Reply-To: <91139f8b-0b83-dd8a-ba53-8e7a499e6344@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 17.12.2020 21:28, Daniel Lezcano пишет: > On 17/12/2020 19:06, Dmitry Osipenko wrote: >> Enable CPU voltage scaling and thermal throttling on Tegra20 Ventana board. >> >> Signed-off-by: Dmitry Osipenko >> --- >> arch/arm/boot/dts/tegra20-ventana.dts | 40 ++++++++++++++++++++++++++- >> 1 file changed, 39 insertions(+), 1 deletion(-) >> >> diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts >> index 14ace2ef749c..c2d9f38960bc 100644 >> --- a/arch/arm/boot/dts/tegra20-ventana.dts >> +++ b/arch/arm/boot/dts/tegra20-ventana.dts >> @@ -2,8 +2,10 @@ >> /dts-v1/; >> >> #include >> +#include >> #include "tegra20.dtsi" >> #include "tegra20-cpu-opp.dtsi" >> +#include "tegra20-cpu-opp-microvolt.dtsi" >> >> / { >> model = "NVIDIA Tegra20 Ventana evaluation board"; >> @@ -527,9 +529,10 @@ ldo_rtc { >> }; >> }; >> >> - temperature-sensor@4c { >> + nct1008: temperature-sensor@4c { >> compatible = "onnn,nct1008"; >> reg = <0x4c>; >> + #thermal-sensor-cells = <1>; >> }; >> }; >> >> @@ -615,10 +618,13 @@ clk32k_in: clock@0 { >> >> cpus { >> cpu0: cpu@0 { >> + cpu-supply = <&vdd_cpu>; >> operating-points-v2 = <&cpu0_opp_table>; >> + #cooling-cells = <2>; >> }; >> >> cpu@1 { >> + cpu-supply = <&vdd_cpu>; >> operating-points-v2 = <&cpu0_opp_table>; >> }; >> }; >> @@ -717,4 +723,36 @@ sound { >> <&tegra_car TEGRA20_CLK_CDEV1>; >> clock-names = "pll_a", "pll_a_out0", "mclk"; >> }; >> + >> + thermal-zones { >> + cpu-thermal { >> + polling-delay-passive = <1000>; /* milliseconds */ >> + polling-delay = <5000>; /* milliseconds */ >> + >> + thermal-sensors = <&nct1008 1>; >> + >> + trips { >> + trip0: cpu-alert0 { >> + /* start throttling at 50C */ >> + temperature = <50000>; >> + hysteresis = <200>; > > Did you mean <2000> ? The <200> is correct. Please see this commit for example: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2b22393b27670b45a2c870bce3df6579efd9a86a >> + type = "passive"; >> + }; >> + >> + trip1: cpu-crit { >> + /* shut down at 60C */ >> + temperature = <60000>; >> + hysteresis = <2000>; > > I think you can drop the hysteresis here, when the critical temperature > is reached, there is an emergency shutdown. Yes, perhaps you're right. Hysteresis doesn't make sense for a critical trip. I'll improve it in the next revision, thanks. > 50°C and 60°C sound very low values, no ? Tegra20 CPU is very cold in comparison to later generations, it should stay under 50°C even at a full load. >> + type = "critical"; >> + }; >> + }; >> + >> + cooling-maps { >> + map0 { >> + trip = <&trip0>; >> + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > > You should add all CPUs here. All CPU cores are coupled on Tegra in regards to CPUFreq, hence I think it won't make any difference if secondary CPU cores will be added here, isn't it?