From patchwork Fri Feb 26 20:20:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8441671 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2462A9F314 for ; Fri, 26 Feb 2016 20:20:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49817203AB for ; Fri, 26 Feb 2016 20:20:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBC4E203AD for ; Fri, 26 Feb 2016 20:20:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755185AbcBZUUS (ORCPT ); Fri, 26 Feb 2016 15:20:18 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:58942 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755152AbcBZUUO (ORCPT ); Fri, 26 Feb 2016 15:20:14 -0500 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0LuLSB-1ZtE492FNf-011mUp; Fri, 26 Feb 2016 21:20:06 +0100 From: Arnd Bergmann To: linuxppc-dev@lists.ozlabs.org Cc: Li Yang , devicetree@vger.kernel.org, "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Jia Hongtao , edubezval@gmail.com, viresh.kumar@linaro.org, Scott Wood Subject: Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree Date: Fri, 26 Feb 2016 21:20:04 +0100 Message-ID: <2396230.MApG9VTrxr@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1448529671-48216-1-git-send-email-hongtao.jia@freescale.com> <3550740.QzZi28fbXg@wuerfel> MIME-Version: 1.0 X-Provags-ID: V03:K0:wpVbhAe77fdSD2sf+A0zXvDbC71eXSiQno18Wmh3KwELxr9umgZ V/QyM7LNHYhfKaO6dMyyLu+P5nq1I+y68e++Ve6IPgtGfdcm2Q954hLZkQj479ZGVF9sBjW M0ITj5w4B/lcAjzNLtoUMATvhbNr4Lyasd14AWe6yzkf8rscwf1kdzgAL23xfGkp49f1W/X U9p5Z8A+/cHuh9/46VrNg== X-UI-Out-Filterresults: notjunk:1; V01:K0:0DZ2Ocby0Vo=:Z7CSObClXPC67hTM1Rr5kK +B4n7Sgq5i5fQItM0gHI/6fciceh+AJf94VB8mLFoJgQlmZqHOLekJVTb2Gx0+w4ad6sLPx4e g1XkoZg9iXTGA3NxBvciSoN86vWmUV2kEhX6WCTwZPa4y00Wk427fF7fWuW2jaIBg68ygxrgl ztqr1l1UQixMOn3ldtu8nAaal13dBUd89m74lUSsjIbuDs64fvrZrQ0yQWXnLljRsJtebMqlt WW41Lo7SwFlkyYmGRHndBvZLGChgbYN2LN2oE5CUEr5k7/0zNPdk22vi45VO1MrZa7/x5+GhL 9laLTwfjgO2PlpXromc3GhQEi/FLffp5XtgrcDZ6cgqrHG9kGyshnYob0H3MvdqqjKO2jbysl XFYzIltCVNc1FZ4ANwtS3DY4KK6fSvAeJoTGrHXU/2HN2a8RLv+HChKHqcMHMC34mrRttIaxz F/FqZzzPFMopVaa+SLO7CDFw88fYyFVHNOxBrT+t3LUyJnceBFNTxmS13JxNy7FjDdzl+iCX/ bLKfcCJNs43MXI0vkB5CTmsAL/YlLV5IyJoehW+aQwLvCk8jbCjN1WuFbqiBzl5KcmvmdhDD6 k5vFJEyaeW0A1PsyB4xt+EaH4o1rC70NO6j8Fa9KgqZJCXS6GavUU/TPvq2rLfvk9kujeUntD UGQFbwsSjqGLb0VTETckBszfoTSW5SlzZEX81oCKXs5hg5KLGgyJN1kOUvqgZ7WNcdeIPyi6P DVj/XBASGXiv7cCG Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Friday 26 February 2016 12:04:59 Li Yang wrote: > On Fri, Dec 18, 2015 at 4:32 PM, Arnd Bergmann wrote: > > On Tuesday 15 December 2015 00:58:26 Rafael J. Wysocki wrote: > >> On Thursday, November 26, 2015 05:21:11 PM Jia Hongtao wrote: > >> > Register the qoriq cpufreq driver as a cooling device, based on the > >> > thermal device tree framework. When temperature crosses the passive trip > >> > point cpufreq is used to throttle CPUs. > >> > > >> > Signed-off-by: Jia Hongtao > >> > Reviewed-by: Viresh Kumar > >> > >> Applied, thanks! > >> > > > > I got a randconfig build error today: > > > > drivers/built-in.o: In function `qoriq_cpufreq_ready': > > debugfs.c:(.text+0x1f4688): undefined reference to `of_cpufreq_cooling_register' > > > > CONFIG_OF=y > > CONFIG_QORIQ_CPUFREQ=y > > CONFIG_THERMAL=m > > CONFIG_THERMAL_OF=y > > > > I think you need a 'depends on THERMAL' to prevent the driver from > > being built-in when THERMAL=m. > > Maybe this is not the best approach. The cpufreq feature itself > should be working independently without thermal framework. I think we > should make the qoriq_cpufreq_ready() defined as null function if > THERMAL is not defined. It already does this when CONFIG_THERMAL is not defined, and my patch doesn't change that. I'm not sure what you are asking for now. Do you want to allow using the cpufreq driver as a built-in driver even when the thermal code is in a module, and then silently skip all thermal management as if it was turned off? That would be this patch: but my feeling is that this would cause more surprises when users find their thermal management is not active even though it was enabled in Kconfig and the thermal module gets loaded. Arnd --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index c156f5082758..a8d9241fc1bb 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -48,7 +48,7 @@ cpufreq_power_cooling_register(const struct cpumask *clip_cpus, * @np: a valid struct device_node to the cooling device device tree node. * @clip_cpus: cpumask of cpus where the frequency constraints will happen */ -#ifdef CONFIG_THERMAL_OF +#if IS_REACHABLE(CONFIG_THERMAL_OF) struct thermal_cooling_device * of_cpufreq_cooling_register(struct device_node *np, const struct cpumask *clip_cpus);