Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1261440ybs; Mon, 25 May 2020 11:08:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq7hm+99I8WhkH38pF7nGLCo0WBgq0w4gxGzbUjdQ5TjwXaIp9Rl/J/mvVU07TlUFjAoPy X-Received: by 2002:a17:906:2e03:: with SMTP id n3mr20018094eji.424.1590430117863; Mon, 25 May 2020 11:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590430117; cv=none; d=google.com; s=arc-20160816; b=uA6NDDxGu1ajL/k+MAZBZW20bNl6xygOBUhJQzTBPJY0UtQnfzAPeIVZoUlBS//Glt EKW6OggvZFGMgWjjzhbFI8bx67DheuzBPLd465QC9eO9oqGffBmEBIbEll/3CvPBEAYq tHmqdeYOlirqzo3Zw4tJ48xZOPUI2iav96eMJXu1X8usIdMEX7sZ5lxK7jugsxRGOKfW 4y7PVRg1QhULR4j8oMBoJ0D/TlFVJ0hEQnMj1nk9Z6fJ6g2O4hKEr8xMQEVDzLIimaeQ hmhuJKIytkf8AVoca91RTzUX324NYCrJdyF6HPQiT4md+qMC3gRLuysb38h+8mt7yGqW Rs7g== 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=mdW5TPC5pBwP0jwDwntViUNqGTKeQcBSi1CWOKkv90w=; b=DBjBHJT6j5GxdtFqnRi0+gxXg+lkl4rd8Jbqo16hNOz3fDGU2Gwsk59zrZK/UrDzu1 60klaRUQxy9XQitlCETQ3bZs75fm4ZZKs7P85rEplxiVxjsY7yfx0lRU5kIGnZIE1LgP xAPlqtg5QYA65LkUMX2R6pR8bjLqFWDH6R1PqstW5z1oHhwbG8iTmRfT5wecAFGNBxbQ tpnrXd+c5xlKFh7KfpMvqy2fdZ39rViXeeHdbnmpkBmlSW3uLk/Wua11WFC/MSWar9bd nAxtAzeSxnGraF84ogpDfHRYks5CgT+pbSwFclfMLTB5GK6q4m4BE6Aadub8rX92N5Ts 8yfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xC4PyPOp; 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 dt12si14098989ejc.99.2020.05.25.11.08.14; Mon, 25 May 2020 11:08:37 -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=xC4PyPOp; 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 S2389975AbgEYLEx (ORCPT + 99 others); Mon, 25 May 2020 07:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389932AbgEYLEw (ORCPT ); Mon, 25 May 2020 07:04:52 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 133C3C05BD43 for ; Mon, 25 May 2020 04:04:52 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id x13so2067699wrv.4 for ; Mon, 25 May 2020 04:04:52 -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=mdW5TPC5pBwP0jwDwntViUNqGTKeQcBSi1CWOKkv90w=; b=xC4PyPOpMkD3gjHORr1MlsIaPoaoO3wxo7sLYizRTeva0cpblXPG3DxEkmPibw0pwZ RYhWtDKVifwl9eqTL0qayhhWFNcOarYklj0GaInqJob9rDfi8aJDVhT2fa9yWDFeKZry zrUXCOFEBzZTCx6Yd5R9FmkNzuyw2JWyK5SNiXb0MagQ8+MhTrKDX/k/u2XH2a8W3kaP ceIc1BJZoD0IjpJaf5YB7JQtzm7SY+30PEocdbxSSrIyV7F9/hweqITPLFBFbVubAqp5 nn0cGCvZWmXdGWKuNT5KfZXJvIc3m0f488iAUVxhuTctIKgGerteTRLuPw69doFs3rW0 XB5w== 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=mdW5TPC5pBwP0jwDwntViUNqGTKeQcBSi1CWOKkv90w=; b=mLBrp0fCxClCpqvdqOODYLg2PxuAm+slg3gb7QQivCAaXnm/e8X1RivPOsIEeLwyTl 3ADqUZk+udtd4Ir2Uhyz68Za9KfvqmPEeNvgcP9L2GcyhIrMt4S3OrFDdh3aCl+rysN4 md6RzfdxqCoCuvyEMrxDPZsBrCcxCDtxbLpKVtGqeqsxZy2YnID/k20jeQzMfCXEpz3F v++emBIM2uyU1rNA+HsCw6P1bkbb9S3hwgwMnVCRfy6tuQu3EqDcmMvWngtZEpsIroPS +M/P6Je4mt7fGMG5jBPCoVSZdUayfJXifPU9Nmndk4p3hmjwXsthNwSveFcmkHaRbqoi jBbg== X-Gm-Message-State: AOAM531nGMmBLmyAArNooVsExu7kGOMUNGyw6Fk79gqGLv183gqXO6wN P9WVwBHXWxd1NzeBGADh3bwXig== X-Received: by 2002:a5d:4b45:: with SMTP id w5mr15497931wrs.358.1590404690512; Mon, 25 May 2020 04:04:50 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:f5b2:610d:e426:c0dd? ([2a01:e34:ed2f:f020:f5b2:610d:e426:c0dd]) by smtp.googlemail.com with ESMTPSA id b185sm437997wmd.3.2020.05.25.04.04.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 May 2020 04:04:49 -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> <6a4d31e4-8a24-2e9f-aa49-bec8258ead4c@linaro.org> From: Daniel Lezcano Message-ID: Date: Mon, 25 May 2020 13:04:48 +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 25/05/2020 04:46, Anson Huang wrote: > Hi, Daniel [ ... ] > I tried modifying the min/max to '2' in cooling map, it works that > whenever cooling action is needed, the max cooling action will be > applied. But I also noticed some behaviors which NOT as expected: > > 1. to easy the test, I enable the " CONFIG_THERMAL_WRITABLE_TRIPS", > and just modify the passive trip threshold to trigger the cooling > action, this is much more easy then putting the board into an oven to > increase the SoC temperature or running many high loading test to > increase the temperature, but when I modify the passive trip > threshold to be lower than current temperature, the cooling action is > NOT triggered immediately, it is because the default step_wise > governor will NOT trigger the cooling action when the trend is > THERMAL_TREND_STABLE. But what expected is, when the temperature is > exceed the passive trip threshold, the cooling action can be > triggered immediately no matter the trend is stable or raising. You are right, what is expected is, when the temperature exceeds the passive trip threshold, a cooling action happens, the trend is raising in this case. But in your test, it is not what is happening: the trip point is changing, not the temperature. Probably, the cpufreq driver is at its lowest OPP, so there is no room for more cooling effect when changing the trip point. IMO, the test is not right as the trip point is decreased to a temperature where actually the SoC is not hot. If you want to test it easily, I recommend to use dhrystone, something like: dhrystone -t 6 -l 10000 That will make your board to heat immediately. > That > means we have to implement our own .get_trend callback? From my POV it must disappear, because it has little meaning. The governor is the one which should be dealing with that and call the corresponding cooling index. > 2. No margin for releasing the cooling action, for example, if > cooling action is triggered, when the temperature drops below the > passive trip threshold, the cooling action will be cancelled > immediately, if SoC keeps running at full performance, the > temperature will increase very soon, which may cause the SoC keep > triggering/cancelling the cooling action around the passive trip > threshold. If there is a margin, the situation will be much better. > > Do you have any idea/comment about them? Yes, that is a good point. The hysteresis is supposed to do that. There is a work done by Andrzej Pietrasiewicz to disable / enable the thermal zones [1]. I think we should be able to fix that after the changes are done. -- Daniel [1] https://www.spinics.net/lists/netdev/msg644762.html -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog