Received: by 10.223.176.46 with SMTP id f43csp994375wra; Wed, 24 Jan 2018 09:00:33 -0800 (PST) X-Google-Smtp-Source: AH8x2261K9CK7SDgLkAPws+r+bwJMzhij5bT0n8WVPLDf3mGfFdni0+KbKW8jIj5wYXRQ1i9yco5 X-Received: by 10.99.144.76 with SMTP id a73mr11152918pge.376.1516813233207; Wed, 24 Jan 2018 09:00:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516813233; cv=none; d=google.com; s=arc-20160816; b=wk6QDp6HTWI/oGV4A/c+KI24PtUbJ4tOrHSsxP1XYOY3fOHZr8ublnU9xS7sj/Jgme uD62zsferhjl3bLaQ/DTOVEeicETGcE7wWvIb2xXAtomsqfjauSutU7ro93jyNGBgH+h Y4pqru9gPLsnthAEbKHh7lWSQM/X8X+wyYy6MB6Mr9yl6zOJ6SeLFOJonwqdyZuZa4NG YhkVQuaE5iXsw3kzFUrXHtwtRt7wywEWpasi0fgpvP1Qg+vg78k1ueLFD7lnZpORy63G 3SZiFILke5LojiwtwboH1MrHtmEkxkFnaCKqZ7p5NXPcVJk7TZbZW9z4J3WNRp92hxtU iFNQ== 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=Jfq8zxGH3TSoA5OovfaZ1RgCpJk7c+AwIK5W6sUMKnk=; b=jOH/IKSgiN4Sd8MdDEQXRRk/i2SRGNMa+kIOILYlgcbBXcdyQam1sDKeSMjXcYI9x2 DQTTOGwcthLuCfBuiASImMhvMxUzldcELtG/2mQnFu9rT3DTvygvOejm51BhR5otAHAT lwukAfjs/+zejwlKguQ8JCIncDSto/ud2Nz3fuyJx347EUzvmPoVPtjh+As21ybq1WAa E7grfU9gFDJdJC59U9hD/VkkXCk4zsF54npDZv8/DZ3fP64Cns2rgXvBx/iJTYZ05ulv QHsNMubJuD8PDu4xEFf9lutIQcIaiVndxUNeD+6ORehp/aCP25qMXGhoM63QWEceg7W6 mghQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LamU+Yar; 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 t15si348436pgq.556.2018.01.24.09.00.13; Wed, 24 Jan 2018 09:00:33 -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=LamU+Yar; 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 S964812AbeAXQ7P (ORCPT + 99 others); Wed, 24 Jan 2018 11:59:15 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35893 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934303AbeAXQ7N (ORCPT ); Wed, 24 Jan 2018 11:59:13 -0500 Received: by mail-wr0-f193.google.com with SMTP id d9so4768231wre.3 for ; Wed, 24 Jan 2018 08:59:12 -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=Jfq8zxGH3TSoA5OovfaZ1RgCpJk7c+AwIK5W6sUMKnk=; b=LamU+YarYq/W7jVWC3nJmvTGhMMxjivNHIuliQ9yjgIJ5+Xdz7lwwiMcDnCYyNTr6m r+aHcYkLdFYogIToJwxgUfwmBndzXojZTzXUTPL++CM6qSu9Io2zc8HLn0yVljDE07MP UaAAAqRsmxjnOoJLoD2F1X5XGRns5Wnf3GlOQ= 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=Jfq8zxGH3TSoA5OovfaZ1RgCpJk7c+AwIK5W6sUMKnk=; b=diabuExXLHpleyJIB1ISArwRMwf8kzwIS1uVoWKP2txBnPR59r+G67jETJbew+CB6n zwJVAZ0qsKzUPwA8YnC2FWHc89vT0sxUSnSkYGHp043xAcV24sHwt/ZxZaSwIlQCAXfH aOJC/OKsMcnd5LBv6f6b+0W2Dzt+5DNSUVLcs44Y1DJdmf0Xm0BLFrQ2i6hIKQ6YH+zx 6VHwtlFwkbtpPDXYuOjM2Iir2AngU/WMZTru+u7TXmLaIirnFF6H1h5PblsHq2Ud2vcB SmuGzrucjv0G0VvhMPP8HR0dg6f4uBK9TCsOvL49gilz7vl+ApYyXNrERomIORv0y9Yx jx/Q== X-Gm-Message-State: AKwxytfpefYS03ol2ptBpnnaP5gJXazdsXfSDt2jUfMFY+hUBOUazk6N gyz7gs0tt/VMsDBHalZc8bs4fA== X-Received: by 10.223.171.77 with SMTP id r13mr6241858wrc.77.1516813152085; Wed, 24 Jan 2018 08:59:12 -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 q195sm749364wmb.33.2018.01.24.08.59.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 08:59:11 -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> From: Daniel Lezcano Message-ID: <02e80d2c-3672-f7e2-dfb2-aed3efc84759@linaro.org> Date: Wed, 24 Jan 2018 17:59:09 +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: <20180124163441.7sqq7qny66d6sqrz@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 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. > 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. > 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. 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. >> Signed-off-by: Daniel Lezcano >> --- >> drivers/thermal/Kconfig | 20 +++++++++++++++++--- >> 1 file changed, 17 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig >> index 315ae29..925e73b 100644 >> --- a/drivers/thermal/Kconfig >> +++ b/drivers/thermal/Kconfig >> @@ -142,17 +142,31 @@ config THERMAL_GOV_POWER_ALLOCATOR >> allocating and limiting power to devices. >> >> config CPU_THERMAL >> - bool "generic cpu cooling support" >> - depends on CPU_FREQ >> + bool "Generic cpu cooling support" >> depends on THERMAL_OF >> help >> + Enable the CPU cooling features. If the system has no active >> + cooling device available, this option allows to use the CPU >> + as a cooling device. >> + >> +choice >> + prompt "CPU cooling strategies" >> + depends on CPU_THERMAL >> + default CPU_FREQ_THERMAL >> + help >> + Select the CPU cooling strategy. >> + >> +config CPU_FREQ_THERMAL >> + bool "CPU frequency cooling strategy" >> + depends on CPU_FREQ >> + help >> This implements the generic cpu cooling mechanism through frequency >> reduction. An ACPI version of this already exists >> (drivers/acpi/processor_thermal.c). >> This will be useful for platforms using the generic thermal interface >> and not the ACPI interface. >> >> - If you want this support, you should say Y here. > > ... this may not be great advice... if you think you want this support > then you *probably* actually want the comboappears to be terrible advice. > > This cooling strategies should only be selected by petrolheads making a > device specific *and* are obsessive about code size. > > The >> +endchoice >> >> config CLOCK_THERMAL >> bool "Generic clock cooling support" >> -- >> 2.7.4 >> -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog