All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: Li Yang <leoli@freescale.com>,
	devicetree@vger.kernel.org,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Jia Hongtao <hongtao.jia@freescale.com>,
	edubezval@gmail.com, viresh.kumar@linaro.org,
	Scott Wood <scottwood@freescale.com>
Subject: Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree
Date: Fri, 26 Feb 2016 21:20:04 +0100	[thread overview]
Message-ID: <2396230.MApG9VTrxr@wuerfel> (raw)
In-Reply-To: <CADRPPNSqXBqD0of0ZorXFOKQc1OQaaJCPFUTMUezJexkegHY9A@mail.gmail.com>

On Friday 26 February 2016 12:04:59 Li Yang wrote:
> On Fri, Dec 18, 2015 at 4:32 PM, Arnd Bergmann <arnd@arndb.de> 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 <hongtao.jia@freescale.com>
> >> > Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
> >>
> >> 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:

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);


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

  reply	other threads:[~2016-02-26 20:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26  9:21 [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree Jia Hongtao
2015-11-26  9:21 ` Jia Hongtao
     [not found] ` <1448529671-48216-1-git-send-email-hongtao.jia-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-12-14 23:58   ` Rafael J. Wysocki
2015-12-14 23:58     ` Rafael J. Wysocki
     [not found]     ` <1697588.dLcbZBRWO4-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2015-12-18 22:32       ` Arnd Bergmann
2015-12-18 22:32         ` Arnd Bergmann
2016-01-11 14:54         ` 答复: " Hongtao Jia
2016-01-11 14:54           ` Hongtao Jia
2016-01-11 17:34           ` Scott Wood
2016-01-11 17:34             ` Scott Wood
2016-01-11 21:13             ` Arnd Bergmann
2016-02-26 18:04         ` Li Yang
2016-02-26 20:20           ` Arnd Bergmann [this message]
2016-02-26 23:07             ` Li Yang
2016-02-26 23:16               ` Arnd Bergmann
2016-02-26 23:31                 ` Li Yang
2016-02-26 23:31                   ` Li Yang
     [not found]                   ` <CADRPPNSASmfxS=BWKvOxGKyCiqno9YvOuAfBaHwKL-Y=jQ2Dzw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-27  0:04                     ` Li Yang
2016-02-27  0:04                       ` Li Yang
2016-02-27  0:08                       ` Scott Wood
2016-02-27  0:08                         ` Scott Wood
     [not found]                         ` <1456531704.5360.53.camel-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org>
2016-02-27  0:41                           ` Li Yang
2016-02-27  0:41                             ` Li Yang
2016-02-29 10:05                             ` Arnd Bergmann
2016-02-29 14:33                               ` Rafael J. Wysocki
2016-02-29 14:39                                 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2396230.MApG9VTrxr@wuerfel \
    --to=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=hongtao.jia@freescale.com \
    --cc=leoli@freescale.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rjw@rjwysocki.net \
    --cc=scottwood@freescale.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.