Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp1058536ybr; Sat, 23 May 2020 05:38:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrkTDPNMyjW30ZZy/OkVsogDILtO0NqQDn3cR7iaSy2JQPT4uduiyabN9SwYabpI1nvvj0 X-Received: by 2002:a17:906:3095:: with SMTP id 21mr12048574ejv.32.1590237488931; Sat, 23 May 2020 05:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590237488; cv=none; d=google.com; s=arc-20160816; b=tTl/6BJWHrMD/pJFRWHe0MNkep2s+A5u8/8tjaLj1HL9838gly02ndCbwIavTMgjJb 5zPVbV90920ABLviDE+HPkLbe3tKC522pTUWzgeEPEdOX0J/41upz+iNlaJS67UFlfnJ 4tpHmVsrvJTBqSbaQJVWKtJdUFv7BSXkonDfGF4TcOWlU1NE60eUv7O5DtNSPSIIp0cy RZgFM85bNxtfrhDo0aGCcZnF2KRSqs74n/cIJeeTY//e3MveejYud52CdKCa8lTYAlWl PwA9oDzZfF1QRod7Y3ZPUO1RYeZaoz/p3RNZXQxdwPU/Du7Dzbhkjjz/fnlqDTQkPcEA yLjw== 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=+ha2P0gI7/dhCR+x1uWrZGR8vEfMxTFQAnCpem5drIw=; b=rcqBzio2jBokYixs9RLgdciGP9ubtIa16kgV7H+b/IrLDbH9pWssfnTXoqLJuxI/fb 6OgXerZslRoz5vkhEVYIODgsMb7gX/ScnS8mkDaHR44VVct5ZOO3KgAIJeMzR2G5PZzv v23/q3yd+Kg+sizLx23aWH/A5ktz3HynQfX2ZdunrjET6J3BtKJ0DfZXawclYz6VU3H9 2GFhnQVuuS8urUvoIQcmR6Lh641pZgLuB/KB4SYgREurVy+edPBO+9y82j5NxP/c1pRh c/8cy274Co3Wovnq+vvuamt83y7b0S5UrsqW6Z4s6RzuHgT3iLD6ovGQ1BKbA0XLt6ux +z0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m5pSwqzq; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si6465190ejb.220.2020.05.23.05.37.45; Sat, 23 May 2020 05:38:08 -0700 (PDT) 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=@linaro.org header.s=google header.b=m5pSwqzq; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731295AbgEWMdq (ORCPT + 99 others); Sat, 23 May 2020 08:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729150AbgEWMdp (ORCPT ); Sat, 23 May 2020 08:33:45 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27054C05BD43 for ; Sat, 23 May 2020 05:33:44 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id c3so8641705wru.12 for ; Sat, 23 May 2020 05:33:44 -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=+ha2P0gI7/dhCR+x1uWrZGR8vEfMxTFQAnCpem5drIw=; b=m5pSwqzqb6HpOMNW5gFCyuwJNBY7jMuVL1za74VwCneV9k6X7R6QpHOUgqEQWRtNn4 SvgCa954xVeXMD3Km6dpuNgUjmocnT70TzaK9JeGyXbRNIY1Sr3DsXl957oOAGywgQsi 2XswZKMKCgiGNlyFjiExEZuBIglEdLs1Ps7G1cuh+GODhvIvW2hSCVJJbuKwtIEswduK Ca8K/X0yHehp9OEEpgRyIWdiOPMG3ADKIc0H9OYpSdEbduubihaEYZDKvrDe4Uq1g4Bu rygpkOerSD5lSVX2Re+Mx0lILNsyegxBIBaxW5W2xzgeXUfsn9fYw9sX273OQBRAf++1 Wvvg== 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=+ha2P0gI7/dhCR+x1uWrZGR8vEfMxTFQAnCpem5drIw=; b=nhHTcgtkdd2nFSpxcacO8Z+IHvrMO4iSQHlQISkV7ZBS4KCcYrApHzNauS+Ka8ycdq 8ZjcOgNWTYLu9B/R57g8/AcfeoWWlE8yacI0v/yt3Pe00DRraNAPvV8Yx8VxY5+Wg546 YhZqDRVmfo6h6R7M5ksSrszweeS3MkJcRl9E9uIWUU3z5j0ogxFyMHeSuhwbDvxir8zt DIi+shSfpOKhqXG0hEff5i5bbT4XTJfksdH0WnuoBRa59akkhsnpSpI3/TrFnaGnxqdI o24S3gd6sbrOqq//jlqHtHGd5scbEvAr7Ux4/7XdJ1uTiX5/SEATzbEjM26rYSGmvTqJ jOdA== X-Gm-Message-State: AOAM530mj0jWPkGYzr1T8QyjoYBsDAs8+8xVI9MQR/ftghvsxl1grIW0 2ePIFMw3Fcn5JlMQzSiYtAIi+g== X-Received: by 2002:adf:fec3:: with SMTP id q3mr1267150wrs.123.1590237222514; Sat, 23 May 2020 05:33:42 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:c871:e070:f68d:a4f7? ([2a01:e34:ed2f:f020:c871:e070:f68d:a4f7]) by smtp.googlemail.com with ESMTPSA id h1sm12875416wme.42.2020.05.23.05.33.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 May 2020 05:33:41 -0700 (PDT) Subject: Re: [PATCH] thermal: imx8mm: Add get_trend ops To: Anson Huang , "rui.zhang@intel.com" , "amit.kucheria@verdurent.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "linux-pm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Cc: dl-linux-imx References: <1589338689-15700-1-git-send-email-Anson.Huang@nxp.com> From: Daniel Lezcano Message-ID: <6a4d31e4-8a24-2e9f-aa49-bec8258ead4c@linaro.org> Date: Sat, 23 May 2020 14:33:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: 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 23/05/2020 02:35, Anson Huang wrote: > Hi, Daniel > > >> Subject: Re: [PATCH] thermal: imx8mm: Add get_trend ops >> >> On 13/05/2020 04:58, Anson Huang wrote: >>> Add get_trend ops for i.MX8MM thermal to apply fast cooling mechanism, >>> when temperature exceeds passive trip point, the highest cooling >>> action will be applied, and when temperature drops to lower than the >>> margin below passive trip point, the lowest cooling action will be >>> applied. >> >> You are not describing what is the goal of this change. > > The goal of this change is to make sure whenever temperature exceeds passive trip point, > the highest cooling action will be applied immediately, e.g., if there are many cpufreq OPP, > the default cooling will be step by step, it will take some more rounds to make cpufreq drop > to lowest OPP, while on i.MX, we expect the cpufreq drop to lowest OPP immediately. Whatever the slope of the temperature increase? >> IIUC, the resulting change will be an on/off action. The thermal zone is >> mitigated with the highest cooling effect, so the lowest OPP, then the >> temperature trend is stable until it goes below the trip - margin where the >> mitigation is stopped. > > Yes, your understanding is correctly, once the temperature exceeds passive trip point, > the highest cooling action will be applied immediately and then it will be stable there > until temperature drop to trip - margin, then the cooling action will be cancelled, the > margin is to avoid the back and forth near the passive trip point. > >> >> Except, I'm missing something, setting a trip point with a 10000 hysteresis and >> a cooling map min/max set to the highest opp will result on the same. > > Yes setting cooling map min/max cooling state to highest OPP will make the highest > cooling action applied immediately, and to have the function of cooling action being > cancelled when temperature drops to trip - margin, I have to define another trip point, > say passive trip point is 85000, and cooling map min/max set to highest OPP in passive > trip point then add another trip point named "active" with 75000, and without any > cooling map in it, right? May be I misunderstood but only the change as below is needed. No need to add a trip point, especially an 'active' trip which is a for an active cooling device like a fan. diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi index cc7152ecedd9..bea263bd06b4 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi @@ -231,10 +231,10 @@ cooling-maps { map0 { trip = <&cpu_alert0>; cooling-device = - <&A53_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, - <&A53_1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, - <&A53_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, - <&A53_3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + <&A53_0 2 2>, + <&A53_1 2 2>, + <&A53_2 2 2>, + <&A53_3 2 2> }; }; }; > If yes, then I think I can try to make the changes in DT instead of thermal driver. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog