From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "open list:CPU FREQUENCY DRIVERS" <linux-pm@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Doug Anderson <dianders@chromium.org>,
Amit Kucheria <amit.kucheria@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Eduardo Valentin <edubezval@gmail.com>,
Matthias Kaehlcke <mka@chromium.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Stephen Boyd <swboyd@chromium.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v1 00/10] cpufreq: Add flag to auto-register as cooling device
Date: Thu, 17 Jan 2019 15:51:07 +0530 [thread overview]
Message-ID: <20190117102107.2n5liu325alisxhd@vireshk-i7> (raw)
In-Reply-To: <CAJZ5v0jUKcRQot9m5VOxqppWWrD-Cy=USpKMRtcq4zJ5EgmHCg@mail.gmail.com>
On 17-01-19, 11:08, Rafael J. Wysocki wrote:
> On Thu, Jan 17, 2019 at 6:49 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > 1. Have following for CONFIG_CPU_FREQ
> > depends on !CPU_THERMAL || THERMAL
>
> Sorry, but this makes my teeth hurt.
I knew it :)
> > The platforms which don't need CPU_THERMAL (like x86) should not
> > enable CPU_THERMAL anymore if they want CONFIG_THERMAL=m.
> >
> > @amit: If this gets accepted, please update the Kconfig entries for
> > all those drivers to not have above lines anymore.
> >
> > - Change CONFIG_THERMAL to bool instead of tristate ?
> >
> > - Anything else ?
>
> The design in the thermal subsystem seems to be upside-down.
> Non-modular code should never be made depend on anything only defined
> in a module.
>
> Would an explicit "select THERMAL" under CPU_THERMAL cause THERMAL to be 'y'?
That causes recursive-dependency issues:
drivers/thermal/Kconfig:5:error: recursive dependency detected!
drivers/thermal/Kconfig:5: symbol THERMAL is selected by CPU_THERMAL
drivers/thermal/Kconfig:16: symbol CPU_THERMAL depends on THERMAL_OF
drivers/thermal/Kconfig:70: symbol THERMAL_OF depends on THERMAL
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
something like this works though:
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 30323426902e..ee9f9f2a795b 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -13,6 +13,20 @@ menuconfig THERMAL
All platforms with ACPI thermal support can use this driver.
If you want this support, you should say Y or M here.
+config CPU_THERMAL
+ bool "generic cpu cooling support"
+ depends on CPU_FREQ
+ select THERMAL_OF
+ select THERMAL
+ 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.
+
if THERMAL
config THERMAL_STATISTICS
@@ -148,19 +162,6 @@ config THERMAL_GOV_POWER_ALLOCATOR
Enable this to manage platform thermals by dynamically
allocating and limiting power to devices.
-config CPU_THERMAL
- bool "generic cpu cooling support"
- depends on CPU_FREQ
- depends on THERMAL_OF
- 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.
-
config CLOCK_THERMAL
bool "Generic clock cooling support"
depends on COMMON_CLK
What about make CONFIG_THERMAL bool instead ? Who wants it to be a module ?
$ git grep "CONFIG_THERMAL=m"
arch/arm/configs/mini2440_defconfig:CONFIG_THERMAL=m
arch/arm/configs/omap2plus_defconfig:CONFIG_THERMAL=m
arch/arm/configs/pxa_defconfig:CONFIG_THERMAL=m
arch/mips/configs/ip22_defconfig:CONFIG_THERMAL=m
arch/mips/configs/ip27_defconfig:CONFIG_THERMAL=m
arch/unicore32/configs/unicore32_defconfig:#CONFIG_THERMAL=m
Not sure if they really want this code out :(
--
viresh
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-17 10:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-14 16:34 [PATCH v1 00/10] cpufreq: Add flag to auto-register as cooling device Amit Kucheria
2019-01-14 16:34 ` [PATCH v1 07/10] cpufreq: mediatek: Use auto-registration of thermal " Amit Kucheria
2019-01-14 16:35 ` [PATCH v1 09/10] cpufreq: scmi: " Amit Kucheria
2019-01-15 10:37 ` Sudeep Holla
2019-01-14 16:35 ` [PATCH v1 10/10] cpufreq: scpi: " Amit Kucheria
2019-01-17 5:49 ` [PATCH v1 00/10] cpufreq: Add flag to auto-register as " Viresh Kumar
2019-01-17 10:08 ` Rafael J. Wysocki
2019-01-17 10:14 ` Rafael J. Wysocki
2019-01-17 10:28 ` Viresh Kumar
2019-01-17 10:31 ` Rafael J. Wysocki
2019-01-17 10:21 ` Viresh Kumar [this message]
2019-01-17 10:29 ` 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=20190117102107.2n5liu325alisxhd@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=amit.kucheria@linaro.org \
--cc=dianders@chromium.org \
--cc=edubezval@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mka@chromium.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sudeep.holla@arm.com \
--cc=swboyd@chromium.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