Re: [PATCH 1/7] thermal/drivers/core: Remove the module Kconfig's option

From: Zhang Rui
Date: Wed Apr 24 2019 - 09:02:17 EST


On ä, 2019-04-23 at 08:52 -0700, Eduardo Valentin wrote:
> Hello,
>
> On Tue, Apr 02, 2019 at 06:12:44PM +0200, Daniel Lezcano wrote:
> >
> > The module support for the thermal subsystem makes little sense:
> > Â- some subsystems relying on it are not modules, thus forcing the
> > ÂÂÂframework to be compiled in
> > Â- it is compiled in for almost every configs, the remaining ones
> > ÂÂÂare a few platforms where I don't see why we can not switch the
> > thermal
> > ÂÂÂto 'y'. The drivers can stay in tristate.
> > Â- platforms need the thermal to be ready as soon as possible at
> > boot time
> > ÂÂÂin order to mitigate
> >
> > Usually the subsystems framework are compiled-in and the plugs are
> > as module.
> >
> > Remove the module option. The removal of the module related dead
> > code will
> > come after this patch gets in or is acked.
>
> I remember some buzilla entry around this some time back.
>
> Rui, do you remember why you made this to be module?
>
> I dont have strong opinion here, but I would like to see
> a better description why we are going this direction rather
> than "most people dont use it as module". Was there any particular
> specific technical motivation?
>
I checked the change log, it seems that we make CONFIG_THERMAL from
bool to tristate long time ago.

commit 63c4ec905d63834a97ec7dbbf0a2ec89ef5872be
Author:ÂÂÂÂÂZhang Rui <rui.zhang@xxxxxxxxx>
AuthorDate: Mon Apr 21 16:07:13 2008 +0800
Commit:ÂÂÂÂÂLen Brown <len.brown@xxxxxxxxx>
CommitDate: Tue Apr 29 02:44:00 2008 -0400

ÂÂÂÂthermal: add the support for building the generic thermal as a
module
ÂÂÂÂ
ÂÂÂÂBuild the generic thermal driver as module "thermal_sys".
ÂÂÂÂ
ÂÂÂÂMake ACPI thermal, video, processor and fan SELECT the generic
ÂÂÂÂthermal driver, as these drivers rely on it to build the sysfs I/F.
ÂÂÂÂ
ÂÂÂÂSigned-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
ÂÂÂÂAcked-by: Jean Delvare <khali@xxxxxxxxxxxx>
ÂÂÂÂSigned-off-by: Len Brown <len.brown@xxxxxxxxx>

But the things described in the changelog does not seem to be a solid
reason why we need thermal to be a module.

Anyway, let's try bool instead of tristate and see if everything still
works well.

thanks,
rui
>
> >
> >
> > Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
> > Acked-by: Guenter Roeck <groeck@xxxxxxxxxxxx>
> > For mini2440:
> > Acked-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> > ---
> > Âarch/arm/configs/mini2440_defconfigÂÂÂÂÂÂÂÂ| 2 +-
> > Âarch/arm/configs/pxa_defconfigÂÂÂÂÂÂÂÂÂÂÂÂÂ| 2 +-
> > Âarch/mips/configs/ip22_defconfigÂÂÂÂÂÂÂÂÂÂÂ| 2 +-
> > Âarch/mips/configs/ip27_defconfigÂÂÂÂÂÂÂÂÂÂÂ| 2 +-
> > Âarch/unicore32/configs/unicore32_defconfig | 2 +-
> > Âdrivers/thermal/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 4 ++--
> > Â6 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm/configs/mini2440_defconfig
> > b/arch/arm/configs/mini2440_defconfig
> > index d95a8059d30b..0cf1c120c4bb 100644
> > --- a/arch/arm/configs/mini2440_defconfig
> > +++ b/arch/arm/configs/mini2440_defconfig
> > @@ -152,7 +152,7 @@ CONFIG_SPI_S3C24XX=y
> > ÂCONFIG_SPI_SPIDEV=y
> > ÂCONFIG_GPIO_SYSFS=y
> > ÂCONFIG_SENSORS_LM75=y
> > -CONFIG_THERMAL=m
> > +CONFIG_THERMAL=y
> > ÂCONFIG_WATCHDOG=y
> > ÂCONFIG_S3C2410_WATCHDOG=y
> > ÂCONFIG_FB=y
> > diff --git a/arch/arm/configs/pxa_defconfig
> > b/arch/arm/configs/pxa_defconfig
> > index d4654755b09c..d4f9dda3a52f 100644
> > --- a/arch/arm/configs/pxa_defconfig
> > +++ b/arch/arm/configs/pxa_defconfig
> > @@ -387,7 +387,7 @@ CONFIG_SENSORS_LM75=m
> > ÂCONFIG_SENSORS_LM90=m
> > ÂCONFIG_SENSORS_LM95245=m
> > ÂCONFIG_SENSORS_NTC_THERMISTOR=m
> > -CONFIG_THERMAL=m
> > +CONFIG_THERMAL=y
> > ÂCONFIG_WATCHDOG=y
> > ÂCONFIG_XILINX_WATCHDOG=m
> > ÂCONFIG_SA1100_WATCHDOG=m
> > diff --git a/arch/mips/configs/ip22_defconfig
> > b/arch/mips/configs/ip22_defconfig
> > index ff40fbc2f439..21a1168ae301 100644
> > --- a/arch/mips/configs/ip22_defconfig
> > +++ b/arch/mips/configs/ip22_defconfig
> > @@ -228,7 +228,7 @@ CONFIG_SERIAL_IP22_ZILOG=m
> > Â# CONFIG_HW_RANDOM is not set
> > ÂCONFIG_RAW_DRIVER=m
> > Â# CONFIG_HWMON is not set
> > -CONFIG_THERMAL=m
> > +CONFIG_THERMAL=y
> > ÂCONFIG_WATCHDOG=y
> > ÂCONFIG_INDYDOG=m
> > Â# CONFIG_VGA_CONSOLE is not set
> > diff --git a/arch/mips/configs/ip27_defconfig
> > b/arch/mips/configs/ip27_defconfig
> > index 81c47e18131b..54db5dedf776 100644
> > --- a/arch/mips/configs/ip27_defconfig
> > +++ b/arch/mips/configs/ip27_defconfig
> > @@ -271,7 +271,7 @@ CONFIG_I2C_PARPORT_LIGHT=m
> > ÂCONFIG_I2C_TAOS_EVM=m
> > ÂCONFIG_I2C_STUB=m
> > Â# CONFIG_HWMON is not set
> > -CONFIG_THERMAL=m
> > +CONFIG_THERMAL=y
> > ÂCONFIG_MFD_PCF50633=m
> > ÂCONFIG_PCF50633_ADC=m
> > ÂCONFIG_PCF50633_GPIO=m
> > diff --git a/arch/unicore32/configs/unicore32_defconfig
> > b/arch/unicore32/configs/unicore32_defconfig
> > index aebd01fc28e5..360cc9abcdb0 100644
> > --- a/arch/unicore32/configs/unicore32_defconfig
> > +++ b/arch/unicore32/configs/unicore32_defconfig
> > @@ -119,7 +119,7 @@ CONFIG_I2C_PUV3=y
> > Â# Hardware Monitoring support
> > Â#CONFIG_SENSORS_LM75=m
> > Â# Generic Thermal sysfs driver
> > -#CONFIG_THERMAL=m
> > +#CONFIG_THERMAL=y
> > Â#CONFIG_THERMAL_HWMON=y
> > Â
> > Â# Multimedia support
> > diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> > index 653aa27a25a4..ccf5b9408d7a 100644
> > --- a/drivers/thermal/Kconfig
> > +++ b/drivers/thermal/Kconfig
> > @@ -3,7 +3,7 @@
> > Â#
> > Â
> > Âmenuconfig THERMAL
> > - tristate "Generic Thermal sysfs driver"
> > + bool "Generic Thermal sysfs driver"
> > Â help
> > Â ÂÂGeneric Thermal Sysfs driver offers a generic mechanism
> > for
> > Â ÂÂthermal management. Usually it's made up of one or more
> > thermal
> > @@ -11,7 +11,7 @@ menuconfig THERMAL
> > Â ÂÂEach thermal zone contains its own temperature, trip
> > points,
> > Â ÂÂcooling devices.
> > Â ÂÂAll platforms with ACPI thermal support can use this
> > driver.
> > - ÂÂIf you want this support, you should say Y or M here.
> > + ÂÂIf you want this support, you should say Y here.
> > Â
> > Âif THERMAL
> > Â