Received: by 10.223.176.46 with SMTP id f43csp974221wra; Wed, 24 Jan 2018 08:40:58 -0800 (PST) X-Google-Smtp-Source: AH8x226F+pDjOZEQ/S1mDZUFH1yvA0get2nVhM5Da91vlH1NEe2jvH/4Jhs7WNPWtv5s3TXQXXYc X-Received: by 10.98.131.200 with SMTP id h191mr13429915pfe.149.1516812058785; Wed, 24 Jan 2018 08:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516812058; cv=none; d=google.com; s=arc-20160816; b=nNouuzY/GUhw6/TaXofTklRiRoeGR6S22sHS2rUMKdKTMbAWzaYA+VA4JNjob6RPPl xC45zkG75sctLXPmmPSmEkqQMaVi2WwSlgtHPZs7xUHLMctxKI0JTNFC5gdL94dPeF+P khjtorxKPY0Pu2ZUTMNoX5/zC2B8m9wcdFihIXkbwQhTQzQxy9jCOcf3r7iaFFWE/7fy aQOXUMVSD6mTWfxjpCJyOcbpTQivut9YAZSZbJ1eIu7De+aGC/HjGr5eAT8dhVAsiQUv 0EHhbR4DY/92tcMFydcjpHXXIbO4RAEOr6vpj9ZatATwXM0eoXp9QepVLVMHwY67ApBm bQeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=14W96dPXUfp7mwToYCP+4oYhlRqh1VNcBxCaPezkQHM=; b=SP3g4SIuOfnzkTszLYy6ykB8pURzq4xK1kTbEkxOhq3p0uybHbMIxBh9fMp/N/6i/e gKKO8z2hXsYmUPEhSkRX2Uq1LsVOkICoqEdtL3vymx/h+jg4q/kHt1VuwLe3aEI166LO xk3qUvBki4Fbj6w+f25g1FnY+bm1zQAZydjeTn0aN8W+0RgsvmybFLXSd1+1Zg6im5+T JvnhzpMGs8GgEBLKI6xFd5Nkape5fwoFg1YvWYqXp7SWi1hPRZ49Qny/7iIZUbQaXmWg 7wNH4ltOy4jbRN6mJI7rgqKII+M6OTT6UUE7ZOtVJSuUV47bmRA5Q7ViG1f+wgll11Sk 8OvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UgL6dOOL; 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 r88si3114615pfl.392.2018.01.24.08.40.44; Wed, 24 Jan 2018 08:40:58 -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=UgL6dOOL; 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 S964847AbeAXQes (ORCPT + 99 others); Wed, 24 Jan 2018 11:34:48 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:44527 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934225AbeAXQeq (ORCPT ); Wed, 24 Jan 2018 11:34:46 -0500 Received: by mail-wm0-f67.google.com with SMTP id t74so9642544wme.3 for ; Wed, 24 Jan 2018 08:34:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=14W96dPXUfp7mwToYCP+4oYhlRqh1VNcBxCaPezkQHM=; b=UgL6dOOLYNVtA1h3/ne6OflZlFhcrfhZXEsPvYRyVM0NdR/xP11o18EJ0utqdLJAvg a6tNPlxpU9vbMEAZpVmpCQ6URJXx1hCpBQ/kAN7jeHV2bywLht8HIcr2E7V19yFbHoJa 9muqgeZe0sMDyUZjGqRqNt7LqlvBBuMfzeEqE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=14W96dPXUfp7mwToYCP+4oYhlRqh1VNcBxCaPezkQHM=; b=ucAWOpGEfPByzcjwYL01O9gl7Tz7+Yh1Ap3GCLGiIX/tYTcW86wC+NzpoRqTj0ljkO PQ267bl1lCQSw7Z4z0xORiOJlfK8GFDYiBIjS7fL4AuTsEMnYk8DntXCdpdRkCBsokEB s2e4I7DVd7FkXnumkD6IygTOzTye4CLTchUHkO9XBYMlatAgLOHCSYrGTM8xrEh1IAaK BOMP3odf6QHCgMX1iLbetiI79br9h01E0qtvWwCoJWOjS8bxi/H/DkdDjWgw+vXHAnWD njz3oqwhVuQDzHwJH6lQ4/taP0s7tXO69cih3th/jiiVOtGRCpupirdgx/Xxi6Qib5Fd UuqA== X-Gm-Message-State: AKwxytc+2Dkc3GhWL+J6uwYwCB8rzWytlmFEJlOZp9AJ0VklGn6X6zCb CfzqLhL+61mfxnmKH3pjv/5xBddy+fs= X-Received: by 10.28.17.17 with SMTP id 17mr5674581wmr.123.1516811684970; Wed, 24 Jan 2018 08:34:44 -0800 (PST) Received: from oak.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id t51sm4940424wrc.21.2018.01.24.08.34.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 08:34:44 -0800 (PST) Date: Wed, 24 Jan 2018 16:34:41 +0000 From: Daniel Thompson To: Daniel Lezcano 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" Subject: Re: [PATCH 4/8] thermal/drivers/Kconfig: Convert the CPU cooling device to a choice Message-ID: <20180124163441.7sqq7qny66d6sqrz@oak.lan> References: <1516721671-16360-1-git-send-email-daniel.lezcano@linaro.org> <1516721671-16360-5-git-send-email-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516721671-16360-5-git-send-email-daniel.lezcano@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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. If the later, how can a distro kernel mitigate the undesired effects whilst still selecting the combo strategy. Daniel. > > 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 >