Received: by 10.223.185.116 with SMTP id b49csp266291wrg; Thu, 22 Feb 2018 21:25:15 -0800 (PST) X-Google-Smtp-Source: AH8x225NAkWul9XBRRzSBBCpHKL3v+j9k0i+qmmWEfXMpDvN44vdJaGehGlRfLWJO9Mt4T2puXVQ X-Received: by 2002:a17:902:5a3:: with SMTP id f32-v6mr579394plf.48.1519363515627; Thu, 22 Feb 2018 21:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519363515; cv=none; d=google.com; s=arc-20160816; b=ZFRHlm7A70AVDnNpS4wzwQvra7IIvX/F1ctsqtxyij6Rf8qchiHjUexEI9/szIXWj8 DcgD6tamiXtZmG6q8SyGtacwt5Z/nTZH7Q7MufJwukzJcRlW8LOWBtx9V06EnyIZkmyB 8YSi9Qr+B0CH2npALfoM69gHpdVrv/rPmAbiHtAUv3WxW5RJw4iGuZaV43b7sqw/03F2 GpxrPVDSN2F5V7dbWwUfdNfHoFBcg9KH3dtMeFVr/gFa9yosB3+cv5Nsp1/jUmeCi40G iG63Z1T1yyM/Qdc6l1hxnnJ7Td7gSXy36uCKKL4Wwf3bnX2FSgyt8S3vrDSWHQI3iDrc EKpQ== 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=O/amTv/TmwCJCVxUYRjNYv+fDL9LYjV9WICliIzqGEw=; b=LrDgqRTVWpLCj66S+FjhAM9nHruhmg/Yih+AuI6WlbeKxjCxCE5x03CBQTCpjGVYXJ 1encqhXVq1TzFaQGbideNhCROLbPlQDqHQZ1oPzfLjCNmwVgyqNPcHCaX5P0r4vFQZlE b9Tj3BkXOB9VxM9RPnXbDKH053g9gMwqhmQ+m0O/qF10lLlVpHAttmtMv3cvFiR9Np+f ltk9kCFe0UhBxz+RxqR+UOkHg7aKHYEE5Fm+mGux30KG0iRo6RJh609K/TUNqHOqNuH8 CoE+lyv9woiFit/ESjJVdtxQUPJ9xLEYN4T3DxwmxqPtEX3n6Ik7JBNJ/BtzAaBUP+Tw WH9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EWDKR2TU; 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 199si1243369pfy.92.2018.02.22.21.25.00; Thu, 22 Feb 2018 21:25:15 -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=EWDKR2TU; 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 S1751407AbeBWFYX (ORCPT + 99 others); Fri, 23 Feb 2018 00:24:23 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36599 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbeBWFYV (ORCPT ); Fri, 23 Feb 2018 00:24:21 -0500 Received: by mail-pg0-f67.google.com with SMTP id j9so2969718pgv.3 for ; Thu, 22 Feb 2018 21:24:20 -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=O/amTv/TmwCJCVxUYRjNYv+fDL9LYjV9WICliIzqGEw=; b=EWDKR2TUqYEQR72dvfHN9uCSbgbygQU9ecqWD1lPakza53eGxC2aINprC5GzKZmtHK K+LNEzEPVSyPxG7ezq6T9YwKwiZMvwWImHKe0a6GCFHsWngB9tzjuS3qN90tCjxMm8Le XD7T/ld1J972VIPROhl4g3NJc9pLIpeyMTOsk= 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=O/amTv/TmwCJCVxUYRjNYv+fDL9LYjV9WICliIzqGEw=; b=hKfzRx1WFadlIlXrBNKu2DpbFhAwwYyIudPOCTHQK3VDNL4WQ4po1kHIXCswLRxqzk /zOjxrd1w3DxfDWcEp+INbqiLLGGXHbINlaFn6SC+nWynqa9GIgjbc+X1nW3ccZZRnNQ Z70w+nzQXG0nXVIMbRm1mw/FIdBrUfLtutldmOBqthL0H21t7MsAV0Bfkxs3swTxs9iU lQVy+05DOqo1tunKzTwreNoh3Q2L1vqG78Bc/q9FnqzmiPPHa83i3Cpb3pEkP5LlXnb6 50PbXbSTM+0oXSHFKIpkXL4BRSknrA1UkN7owQw9dYlqBWS82UIWmQK/LiXYhdudR2SV 92gw== X-Gm-Message-State: APf1xPA+d+xJKRPo7Ouc5MEcCFrf1fWx4qWFvuJDmgKw3AzkEq9KafSS LFw3Pbw8lNotamoUlkiNKa2ibw== X-Received: by 10.101.100.9 with SMTP id a9mr477885pgv.102.1519363460327; Thu, 22 Feb 2018 21:24:20 -0800 (PST) Received: from localhost ([122.167.232.138]) by smtp.gmail.com with ESMTPSA id n190sm2154520pga.89.2018.02.22.21.24.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 21:24:18 -0800 (PST) Date: Fri, 23 Feb 2018 10:54:16 +0530 From: Viresh Kumar To: Daniel Lezcano Cc: edubezval@gmail.com, kevin.wangtao@linaro.org, leo.yan@linaro.org, vincent.guittot@linaro.org, amit.kachhap@gmail.com, linux-kernel@vger.kernel.org, javi.merino@kernel.org, rui.zhang@intel.com, daniel.thompson@linaro.org, linux-pm@vger.kernel.org Subject: Re: [PATCH V2 4/7] thermal/drivers/Kconfig: Convert the CPU cooling device to a choice Message-ID: <20180223052416.GE26947@vireshk-i7> References: <1519226968-19821-1-git-send-email-daniel.lezcano@linaro.org> <1519226968-19821-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: <1519226968-19821-5-git-send-email-daniel.lezcano@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-02-18, 16:29, 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. Daniel T. already raised his concern (which I share too) about the multi-platform builds, where we would want this to be runtime selectable. I am fine with your approach of making that possible later on, but I would really like that to be merged before the combo thing comes in. So, I would suggest to merge stuff in this order: - this series - runtime selectable strategy - combo stuff I hope that would be fine ? > Signed-off-by: Daniel Lezcano > --- > drivers/thermal/Kconfig | 20 +++++++++++++++++--- > drivers/thermal/cpu_cooling.c | 2 ++ > include/linux/cpu_cooling.h | 6 +++--- > 3 files changed, 22 insertions(+), 6 deletions(-) > > diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig > index b6adc54..5aaae1b 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. Should this line be moved to the CPU_THERMAL section above ? > +endchoice > > config CLOCK_THERMAL > bool "Generic clock cooling support" > diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c > index 7bdc19f..5c219dc 100644 > --- a/drivers/thermal/cpu_cooling.c > +++ b/drivers/thermal/cpu_cooling.c > @@ -22,6 +22,7 @@ > > #include > > +#ifdef CONFIG_CPU_FREQ_THERMAL > /* > * Cooling state <-> CPUFreq frequency > * > @@ -926,3 +927,4 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) > kfree(cpufreq_cdev); > } > EXPORT_SYMBOL_GPL(cpufreq_cooling_unregister); > +#endif /* CONFIG_CPU_FREQ_THERMAL */ > diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h > index d4292eb..c0accc7 100644 > --- a/include/linux/cpu_cooling.h > +++ b/include/linux/cpu_cooling.h > @@ -33,7 +33,7 @@ struct cpufreq_policy; > typedef int (*get_static_t)(cpumask_t *cpumask, int interval, > unsigned long voltage, u32 *power); > > -#ifdef CONFIG_CPU_THERMAL > +#ifdef CONFIG_CPU_FREQ_THERMAL > /** > * cpufreq_cooling_register - function to create cpufreq cooling device. > * @policy: cpufreq policy. > @@ -84,7 +84,7 @@ of_cpufreq_power_cooling_register(struct device_node *np, > */ > void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); > > -#else /* !CONFIG_CPU_THERMAL */ > +#else /* !CONFIG_CPU_FREQ_THERMAL */ > static inline struct thermal_cooling_device * > cpufreq_cooling_register(struct cpufreq_policy *policy) > { > @@ -118,6 +118,6 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) > { > return; > } > -#endif /* CONFIG_CPU_THERMAL */ > +#endif /* CONFIG_CPU_FREQ_THERMAL */ > > #endif /* __CPU_COOLING_H__ */ drivers/cpufreq/Kconfig: # if CPU_THERMAL is on and THERMAL=m, CPUFREQ_DT cannot be =y: drivers/cpufreq/Kconfig: depends on !CPU_THERMAL || THERMAL drivers/cpufreq/Kconfig: depends on !CPU_THERMAL || THERMAL drivers/cpufreq/Kconfig.arm: # if CPU_THERMAL is on and THERMAL=m, ARM_BIT_LITTLE_CPUFREQ cannot be =y drivers/cpufreq/Kconfig.arm: depends on !CPU_THERMAL || THERMAL drivers/cpufreq/Kconfig.arm: depends on !CPU_THERMAL || THERMAL All of these need to use CPU_FREQ_THERMAL now. include/trace/events/thermal.h:#ifdef CONFIG_CPU_THERMAL include/trace/events/thermal.h:#endif /* CONFIG_CPU_THERMAL */ And this too. -- viresh