Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5270665rwd; Mon, 12 Jun 2023 02:32:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79fFDDw5YkIwnjywyHTkUKFChZbH+XSgyyCZbJ4PohelT+EaBX08MW/wKVLetBVZlpzFW1 X-Received: by 2002:a17:906:db06:b0:978:afbc:678f with SMTP id xj6-20020a170906db0600b00978afbc678fmr8684161ejb.1.1686562323965; Mon, 12 Jun 2023 02:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562323; cv=none; d=google.com; s=arc-20160816; b=olPJxoxuEH5PyIjwA8GAUhkoI7UNumg3/m0j+EyDWbtuf3c74P2reMCc+afRlcX4RW nvn7GQBCdsWPJAIQXYS3jXmUHlb7JmKVG/kOErtq9UP86s1pxcF8/Z+hCbNXaaB2zF19 vRfYn3fx9k4hoOBR3SuOHqV2clIOeOYVjSRxBTvpXRzu1eJ7Q3f4SjX2hYYnhNha54Vu 1hSLk+pMNZfnBlryfcTgLK3SPHvyoSaxmcYNKmTSgyeuMf0MTIzu6Kt8xY7glfYOoTuc OTdI3oEdfBl7ZH/NM9d2kut9jy/EPoadJ3JBRj0Zr/4riGvUD0AkWLP/4tw4V2QyaAxu fhAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1ALIq+EfBjjDuq9C6qScccN3SzZCAcSKnABbFzkS/tA=; b=xq67z1s8UKKAJGKLv+RtWiP8+MMx3MKGAe4gKVtx898CnrMMdS0znfGqW+3pFZJl6P 6br/Ye76GQv62NKFTUv93pOonD2itw3+yRfWVhbkAEaB1r5kWJmqrBV9RKRIX9bnNo+a 3URhObOxD8ukI7n5CqwrupTtf64dCJrvbc3qNp2Ny4ncwQ4eKY3yFyLLOBl9Roc/rcYg zrPbYV5FhxMISMHwzBeG7/xrYWnjA/+pDuGjh6JkRDsBun+sP3yeLDmE2f0rsykxlKZN MpO7sJRwg80yDoESj08Oc9ZVCF57W/5Ei7FaorEIUs+6+u7Yb8uKII3uNYzxGH0o8WSn BaAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jUQCmi8C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a1709062c4c00b0097104874bfesi5212274ejh.259.2023.06.12.02.31.38; Mon, 12 Jun 2023 02:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jUQCmi8C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229735AbjFLJOS (ORCPT + 99 others); Mon, 12 Jun 2023 05:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbjFLJNs (ORCPT ); Mon, 12 Jun 2023 05:13:48 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 387234C1D for ; Mon, 12 Jun 2023 02:07:22 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30ae141785bso3800379f8f.3 for ; Mon, 12 Jun 2023 02:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686560829; x=1689152829; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1ALIq+EfBjjDuq9C6qScccN3SzZCAcSKnABbFzkS/tA=; b=jUQCmi8C9INCz6PusbgHt8ozZvFHq+MkPgx7w99W4qdxMwkqzIwQrAgZX10wHogWs+ MWqQAbhHBX+xg/ZvKkgKnt/qT2htAo0Q/Lz/giT7tXbLvrY60RsRkyJrFFx1iwBbmFIf 7OSzNbu/aQ6B2qg3Ks4Cz8UsWIfaMACUoAW9EZEYdA9voeXu+M925i5D9RZ793o155aZ OYZQs5LfjoTjIYefaKaClzFCSD6CO9f4HaFBjAaZgi75KLYfS2IgTsg8Ofha0xuEqVGl gFUBi5OhX+evzMPkextYpITqK5+4MlD/S2nuEZYFzR/CJlbn89iAKBaEvWELDGNrN1A6 IgPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686560829; x=1689152829; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1ALIq+EfBjjDuq9C6qScccN3SzZCAcSKnABbFzkS/tA=; b=VIQrxGQZ3nQVh+yG69po8q375uS8ET2169haOXXJegPYpCe+wofx5tSPFPMdTbfXDS BlHx9tw/xkwc/+EAI0BbgTiVqLeSeV0MlYX3ncr3QtK0xHIBKozF/LEfWCCoAvgEmSTq COvAqd1QXZH7pQeh2GbiOXhoBmKXezN/qIbEibhvdIC4dqCiZOMOb/Ud21OF8B0VPTNT ADo/aP7zrg5VgMeq+pQph4OfmTt25wWDKr2essv+B2mJF3BBgr/Senby8PcRNL13Ms5j Y3qgPLG0mqexx1Gg0DTZyVC7l3YYYuBxXZdBEbJve1yzOQ8U9fzfvNDdR/Ra/DiUjeEj htMw== X-Gm-Message-State: AC+VfDwligS0gbFN2jVv/Oced1hyI29u1SBH7CPzQrq4bB1LWptSLwng o8YXYNrBnpw8emMJMoxBByNuiw== X-Received: by 2002:a5d:5050:0:b0:30f:c56c:b5a6 with SMTP id h16-20020a5d5050000000b0030fc56cb5a6mr887326wrt.4.1686560828937; Mon, 12 Jun 2023 02:07:08 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:bb02:9baa:82d1:2486? ([2a05:6e02:1041:c10:bb02:9baa:82d1:2486]) by smtp.googlemail.com with ESMTPSA id u8-20020adfeb48000000b003062b2c5255sm11875361wrn.40.2023.06.12.02.07.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 02:07:08 -0700 (PDT) Message-ID: <3c501536-2620-0022-df93-415d490fc1a5@linaro.org> Date: Mon, 12 Jun 2023 11:07:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] thermal: Allow selecting the bang-bang governor as default Content-Language: en-US To: Thierry Reding , "Rafael J . Wysocki" Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230609124408.3788680-1-thierry.reding@gmail.com> From: Daniel Lezcano In-Reply-To: <20230609124408.3788680-1-thierry.reding@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thierry, On 09/06/2023 14:44, Thierry Reding wrote: > From: Thierry Reding > > For many setups the bang-bang governor is exactly what we want. Many > ARM SoC-based devices use fans to cool down the entire SoC and that > works well only with the bang-bang governor because it uses the > hysteresis in order to let the fan run for a while to cool the SoC > down below the trip point before switching it off again. Yeah, that trip point detection is screwed up at the moment, but we are on the way to solve that. From there, we should be able to have the step_wise governor working as the bang-bang governor and remove this one. Meanwhile, the change sounds ok for me. Rafael, may I pick this change? > The step-wise governor will behave strangely in these situations. It > doesn't use the hysteresis, so it can lead to situations where the fan > is turned on for only a very brief period and then is switched back off, > only to get switched back on again very quickly because the SoC hasn't > cooled down very much. > > Signed-off-by: Thierry Reding > --- > drivers/thermal/Kconfig | 8 ++++++++ > drivers/thermal/thermal_core.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig > index 4cd7ab707315..19a4b33cb564 100644 > --- a/drivers/thermal/Kconfig > +++ b/drivers/thermal/Kconfig > @@ -130,6 +130,14 @@ config THERMAL_DEFAULT_GOV_POWER_ALLOCATOR > system and device power allocation. This governor can only > operate on cooling devices that implement the power API. > > +config THERMAL_DEFAULT_GOV_BANG_BANG > + bool "bang_bang" > + depends on THERMAL_GOV_BANG_BANG > + help > + Use the bang_bang governor as default. This throttles the > + devices one step at the time, taking into account the trip > + point hysteresis. > + > endchoice > > config THERMAL_GOV_FAIR_SHARE > diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h > index 3d4a787c6b28..17c1bbed734d 100644 > --- a/drivers/thermal/thermal_core.h > +++ b/drivers/thermal/thermal_core.h > @@ -23,6 +23,8 @@ > #define DEFAULT_THERMAL_GOVERNOR "user_space" > #elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR) > #define DEFAULT_THERMAL_GOVERNOR "power_allocator" > +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_BANG_BANG) > +#define DEFAULT_THERMAL_GOVERNOR "bang_bang" > #endif > > /* Initial state of a cooling device during binding */ -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog