Received: by 10.223.176.46 with SMTP id f43csp2140055wra; Thu, 25 Jan 2018 05:37:44 -0800 (PST) X-Google-Smtp-Source: AH8x225pyLWLZeb6oOKfG3sN4A27wawn/1KwO9hoaui21+9jnBNxHK2EIxYh3qffP5+hmUb3dZeG X-Received: by 2002:a17:902:aa88:: with SMTP id d8-v6mr11107574plr.171.1516887464475; Thu, 25 Jan 2018 05:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516887464; cv=none; d=google.com; s=arc-20160816; b=0kCClN88aRaTA4Pp0Uc0EWGE+QC4wVi02XWA7JF/wzLo+EvWt50P0UQNAsTfHsPGk3 qG832L8NUhXnka2eYaL04Xi7C5a7nUDr7EZBjXg7Y9aHU2+TTqEuKy7PwBKs1bNWo9X0 Bbq9mmR74zF97qVlWOAnBomJnkcBbnbijbEm9XIQ75p/d3hJHEOFbeylFVQ/Wt9efwS+ UpigfrJK5/9OKDBhG8usk7bLWqLR6jzTShV7jOG7TQQGlP5nR4jd/MCe9vkR/qQvG4JS cD00aYp5txzDm1fnKQS57iL3Rll6wGoxK/eSd0V+h+nDNULP/j3Mq62A1ifODiAcEjWH iioA== 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 :arc-authentication-results; bh=PEJXb+PXL8bD7psSyGiUBp9NpM42rruZKnIoLaTA1rg=; b=rDTVw3SDARYv4aHzpKtCQdd1fedAkYEWJlLJGtJJ/c9/B7IgCFFDBgPy+/dqR2Sp9J Em4gkLr/cJgqNYvHK1TY7WZ4YtMEL7urK6XQDDQMXdeNWoenuvexfJryE8BO8LQkyc8d 1lUUFr8RbEO/K/HY6G7eA0rz8JcOA+JQ+YoBFeYOt5asg7xuFfO8eWjnIOqRkwXZ54Ub KGhitgb0cnHsIXuM3kZnuGpYh1ue4EQtd1S0h6I4zCQZSwY7DsF+ES/3NV36CforQZ4S g5pJLsO1u0Voi6YWnGZp1RNcB6kCwHMJVIanxy3CmnUMek6mCyZCMa6sEizJk04T1I5V d8jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2qfjRak; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si1574968pgo.128.2018.01.25.05.37.30; Thu, 25 Jan 2018 05:37:44 -0800 (PST) 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=@linaro.org header.s=google header.b=O2qfjRak; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbeAYNgT (ORCPT + 99 others); Thu, 25 Jan 2018 08:36:19 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:43195 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbeAYNgP (ORCPT ); Thu, 25 Jan 2018 08:36:15 -0500 Received: by mail-wm0-f66.google.com with SMTP id g1so14632491wmg.2 for ; Thu, 25 Jan 2018 05:36:14 -0800 (PST) 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=PEJXb+PXL8bD7psSyGiUBp9NpM42rruZKnIoLaTA1rg=; b=O2qfjRakm2VeGqKIAeYsFFNvxwfb4e37CjrdjvNQv/6WVy1xELNBVYRCKfDFktEZE5 k8sCdoIhcQ938/qIjzPlCBioyf/DfJOE2XiHP8QvWWGL76vRhbAjjkrOfP+15EMqRGeI /XfiStxTzzfcxT1MjMewfFOXy2SyMPrjBnuK8= 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=PEJXb+PXL8bD7psSyGiUBp9NpM42rruZKnIoLaTA1rg=; b=EO9DOORnuSzYQQg9Y0vxtgPaASwl1zl1BBmFIrJmxtPEiFFAyQzU7oI7ihItC/ivsY Qppkg92ypoAw4DUaEbOkLeRx9yumAxh1Z7obcJUED8a67oz+ATyyvTjk0C7ERJ69zzbh mFB+OYGBLqOiKIdB8WtG4dn3lhdrfswO1BoAYXFnAnEmoqYw1R/SeQlXI76tqt5ZMBJd //Yjq28/XOD0nC9UAofffuKK/muwhh9Vc7jtXJKXgujq7O8H5GD/uS8uqWp0Lkq/t1eS UXNUjtzoQp6WPDWqmxcohyvVQHizN0HGQxcc89h4jZ0TqGeXkGZPPC1fI4wg6KVhqVtQ wmOg== X-Gm-Message-State: AKwxytfOqbsVlDVKJFscOJsyHOCm1YvoZp98OUVRwMQYpS5XOGHUjMaa GqpKLuM9IX5B5JRUfP9iA6N9aw== X-Received: by 10.28.238.217 with SMTP id j86mr7424427wmi.151.1516887373876; Thu, 25 Jan 2018 05:36:13 -0800 (PST) Received: from ?IPv6:2a01:e35:879a:6cd0:3e97:eff:fe5b:1402? ([2a01:e35:879a:6cd0:3e97:eff:fe5b:1402]) by smtp.googlemail.com with ESMTPSA id t51sm7900057wrc.21.2018.01.25.05.36.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 05:36:13 -0800 (PST) Subject: Re: [PATCH 4/8] thermal/drivers/Kconfig: Convert the CPU cooling device to a choice To: Daniel Thompson Cc: edubezval@gmail.com, kevin.wangtao@linaro.org, leo.yan@linaro.org, vincent.guittot@linaro.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, Zhang Rui , "open list:THERMAL" References: <1516721671-16360-1-git-send-email-daniel.lezcano@linaro.org> <1516721671-16360-5-git-send-email-daniel.lezcano@linaro.org> <20180124163441.7sqq7qny66d6sqrz@oak.lan> <02e80d2c-3672-f7e2-dfb2-aed3efc84759@linaro.org> <20180125105715.sae3nwvz7u32v4va@oak.lan> From: Daniel Lezcano Message-ID: Date: Thu, 25 Jan 2018 14:36:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180125105715.sae3nwvz7u32v4va@oak.lan> 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/01/2018 11:57, Daniel Thompson wrote: > On Wed, Jan 24, 2018 at 05:59:09PM +0100, Daniel Lezcano wrote: >> On 24/01/2018 17:34, Daniel Thompson wrote: >>> On Tue, Jan 23, 2018 at 04:34:27PM +0100, Daniel Lezcano wrote: >>>> The next changes will add new way to cool down a CPU. In order to >>>> sanitize and make the overall cpu cooling code consistent and robust >>>> we must prevent the cpu cooling devices to co-exists with the same >>>> purpose at the same time in the kernel. >>>> >>>> Make the CPU cooling device a choice in the Kconfig, so only one CPU >>>> cooling strategy can be chosen. >>> >>> I puzzled by the role of Kconfig here. >>> >>> IIUC a distro kernel will always be forced to select the combo strategy >>> otherwise it will never be able to cool systems that don't have cpufreq >>> (I hope the combo strategy treats such system as a special case with >>> only one OPP). >> >> Actually it does not make sense to select the combo if there is no >> cpufreq support. The cpuidle cooling device must be used instead. > > Well, I said before what I hoped. This is what I feared! ;-) > > >>> This raises the question what the other options (cpufreq-only >>> idle-injection-only) are for? Are they just for petrol heads who want to >>> save a few bytes of code or is idle-injection undesirable for some >>> users. >> >> The combo cooling device must be used on a system with a proper support >> for cpuidle and cpufreq and with the power numbers specified in the DT. >> >> By proper support of cpuidle, I mean a cluster power down idle state, >> fast enough. This idle state allows to drop the dynamic power *and* the >> static leakage (the latter to prevent a thermal runaway). >> >> If the system does not have power numbers, no (or bad) cpuidle, the >> combo cooling device must not be used. If there is no cpufreq support, >> the cpuidle cooling must be used and if there is no proper support for >> both, the CPU cooling can't be used. In this case, you have to put a fan >> on your board or reduce the frequency where the system stays in its >> thermal envelope. > > How can we know (in the general case) what is going to be in the DT at > compile time? > > >>> If the later, how can a distro kernel mitigate the undesired effects >>> whilst still selecting the combo strategy. >> >> I'm not sure to understand the question. Distros always use the make >> allmodconfig, so that chooses the cpufreq CPU cooling device which was >> the case before without this change. > > So there's no regression. That's nice but doesn't that mean distros > cannot exploit the new features. > > >> However, we are talking about distros here but the CPU cooling mechanism >> is for mobile and in this case the kernel (usually Android based) comes >> with a specific configuration file and this is where the SoC vendor has >> to choose the right strategy. > > I agree its hard to conceive of a modern Android device that doesn't implement > both the needed features but the performance figures in the covering > letter come from Hikey (and they look pretty good) and Hikey is > supported by a good number of regular Linux distros now. > > Using Kconfig to force what should be runtime decisions to happen at > compile time means that Hikey becomes an example of a platform that > is unable to run at max performance on the distros that have added > support for it. I disagree. The ARM64's defconfig is not distro ready. We have always to change the default option and fix things in the Kconfig to make the hikey to work (eg. the missing hi655x clock config), without speaking about the hikey960 which is not yet ready for full support. Hence, tweaking the Kconfig to choose the better strategy is not necessarily a problem for this first iteration of code. Note I'm not against changing the code to make it runtime selectable but that will need a major rework of the current CPU cooling code especially handling the change while the thermal framework is doing the mitigation (and probably also changes of the thermal framework). I prefer to keep simple self-encapsulated feature code and make it evolve to something better instead of sending a blowing patch series taking into account all possible combinations. Choosing the strategy at compile time may be look restrictive but we can live with that without problem and iteratively do the change until the choice becomes the default strategy selection option. Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog