linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Amit Kucheria <amit.kucheria@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Taniya Das <tdas@codeaurora.org>,
	Anson Huang <anson.huang@nxp.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v5 1/9] thermal: cpu_cooling: Require thermal core to be compiled in
Date: Thu, 31 Jan 2019 00:53:19 +0100	[thread overview]
Message-ID: <4397205.6VUyJNULaB@aspire.rjw.lan> (raw)
In-Reply-To: <0d63ca44cff5f47ef0102b2c86b4fe9eca9b658b.1548737236.git.amit.kucheria@linaro.org>

On Tuesday, January 29, 2019 5:55:07 AM CET Amit Kucheria wrote:
> The CPU cooling driver (cpu_cooling.c) allows the platform's cpufreq
> driver to register as a cooling device and cool down the platform by
> throttling the CPU frequency. In order to be able to auto-register a
> cpufreq driver as a cooling device from the cpufreq core, we need access
> to code inside cpu_cooling.c which, in turn, accesses code inside
> thermal core.
> 
> CPU_FREQ is a bool while THERMAL is tristate.  In some configurations
> (e.g. allmodconfig), CONFIG_THERMAL ends up as a module while
> CONFIG_CPU_FREQ is compiled in. This leads to following error:
> 
> drivers/cpufreq/cpufreq.o: In function `cpufreq_offline':
> cpufreq.c:(.text+0x407c): undefined reference to `cpufreq_cooling_unregister'
> drivers/cpufreq/cpufreq.o: In function `cpufreq_online':
> cpufreq.c:(.text+0x70c0): undefined reference to `of_cpufreq_cooling_register'
> 
> Given that platforms using CPU_THERMAL usually want it compiled-in so it
> is available early in boot, make CPU_THERMAL depend on THERMAL being
> compiled-in instead of allowing it to be a module.
> 
> As a result of this change, get rid of the ugly (!CPU_THERMAL ||
> THERMAL) dependency in all cpufreq drivers using CPU_THERMAL.
> 
> Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/Kconfig     | 3 ---
>  drivers/cpufreq/Kconfig.arm | 5 -----
>  drivers/thermal/Kconfig     | 1 +
>  3 files changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 608af20a3494..b22e6bba71f1 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -207,8 +207,6 @@ comment "CPU frequency scaling drivers"
>  config CPUFREQ_DT
>  	tristate "Generic DT based cpufreq driver"
>  	depends on HAVE_CLK && OF
> -	# if CPU_THERMAL is on and THERMAL=m, CPUFREQ_DT cannot be =y:
> -	depends on !CPU_THERMAL || THERMAL
>  	select CPUFREQ_DT_PLATDEV
>  	select PM_OPP
>  	help
> @@ -327,7 +325,6 @@ endif
>  config QORIQ_CPUFREQ
>  	tristate "CPU frequency scaling driver for Freescale QorIQ SoCs"
>  	depends on OF && COMMON_CLK && (PPC_E500MC || ARM || ARM64)
> -	depends on !CPU_THERMAL || THERMAL
>  	select CLK_QORIQ
>  	help
>  	  This adds the CPUFreq driver support for Freescale QorIQ SoCs
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 688f10227793..ca8567c3152c 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -29,8 +29,6 @@ config ARM_ARMADA_37XX_CPUFREQ
>  config ARM_BIG_LITTLE_CPUFREQ
>  	tristate "Generic ARM big LITTLE CPUfreq driver"
>  	depends on ARM_CPU_TOPOLOGY && HAVE_CLK
> -	# if CPU_THERMAL is on and THERMAL=m, ARM_BIT_LITTLE_CPUFREQ cannot be =y
> -	depends on !CPU_THERMAL || THERMAL
>  	select PM_OPP
>  	help
>  	  This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
> @@ -38,7 +36,6 @@ config ARM_BIG_LITTLE_CPUFREQ
>  config ARM_SCPI_CPUFREQ
>  	tristate "SCPI based CPUfreq driver"
>  	depends on ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
> -	depends on !CPU_THERMAL || THERMAL
>  	help
>  	  This adds the CPUfreq driver support for ARM platforms using SCPI
>  	  protocol for CPU power management.
> @@ -93,7 +90,6 @@ config ARM_KIRKWOOD_CPUFREQ
>  config ARM_MEDIATEK_CPUFREQ
>  	tristate "CPU Frequency scaling support for MediaTek SoCs"
>  	depends on ARCH_MEDIATEK && REGULATOR
> -	depends on !CPU_THERMAL || THERMAL
>  	select PM_OPP
>  	help
>  	  This adds the CPUFreq driver support for MediaTek SoCs.
> @@ -233,7 +229,6 @@ config ARM_SA1110_CPUFREQ
>  config ARM_SCMI_CPUFREQ
>  	tristate "SCMI based CPUfreq driver"
>  	depends on ARM_SCMI_PROTOCOL || COMPILE_TEST
> -	depends on !CPU_THERMAL || THERMAL
>  	select PM_OPP
>  	help
>  	  This adds the CPUfreq driver support for ARM platforms using SCMI
> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> index 30323426902e..58bb7d72dc2b 100644
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -152,6 +152,7 @@ config CPU_THERMAL
>  	bool "generic cpu cooling support"
>  	depends on CPU_FREQ
>  	depends on THERMAL_OF
> +	depends on THERMAL=y
>  	help
>  	  This implements the generic cpu cooling mechanism through frequency
>  	  reduction. An ACPI version of this already exists
> 

Applied, thanks!



  reply	other threads:[~2019-01-30 23:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  4:55 [PATCH v5 0/9] cpufreq: Add flag to auto-register as cooling device Amit Kucheria
2019-01-29  4:55 ` [PATCH v5 1/9] thermal: cpu_cooling: Require thermal core to be compiled in Amit Kucheria
2019-01-30 23:53   ` Rafael J. Wysocki [this message]
2019-01-29  4:55 ` [PATCH v5 2/9] cpufreq: Auto-register the driver as a thermal cooling device if asked Amit Kucheria
2019-01-29  5:36   ` Viresh Kumar
2019-01-29  5:46     ` Amit Kucheria
2019-01-29  6:20       ` Amit Kucheria
2019-01-29  7:09         ` Viresh Kumar
2019-01-29  9:16           ` Rafael J. Wysocki
2019-01-29  9:13       ` Rafael J. Wysocki
2019-01-29 20:20         ` Amit Kucheria
2019-01-29 22:22           ` Rafael J. Wysocki
2019-01-30  5:22             ` [PATCH] " Amit Kucheria
2019-01-30  6:34               ` Viresh Kumar
2019-01-30  7:28               ` Daniel Lezcano
2019-01-29  4:55 ` [PATCH v5 3/9] cpufreq: qcom-hw: Register as a cpufreq cooling device Amit Kucheria
2019-01-29  4:55 ` [PATCH v5 4/9] cpufreq: imx6q: Use auto-registration of thermal " Amit Kucheria
2019-01-29  4:55 ` [PATCH v5 5/9] cpufreq: cpufreq-dt: " Amit Kucheria
2019-01-29  4:55 ` [PATCH v5 6/9] cpufreq: mediatek: " Amit Kucheria
2019-02-06 13:55   ` Matthias Brugger
2019-01-29  4:55 ` [PATCH v5 7/9] cpufreq: qoriq: " Amit Kucheria
2019-01-29  4:55 ` [PATCH v5 8/9] cpufreq: scmi: " Amit Kucheria
2019-01-29  4:55 ` [PATCH v5 9/9] cpufreq: scpi: " Amit Kucheria
2019-02-06 10:32 ` [PATCH v5 0/9] cpufreq: Add flag to auto-register as " Rafael J. Wysocki

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=4397205.6VUyJNULaB@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=amit.kucheria@linaro.org \
    --cc=anson.huang@nxp.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=sudeep.holla@arm.com \
    --cc=tdas@codeaurora.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).