]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
thermal: Get rid of CONFIG_THERMAL_WRITABLE_TRIPS
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 12 Feb 2024 18:26:25 +0000 (19:26 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Feb 2024 17:24:48 +0000 (18:24 +0100)
The only difference made by CONFIG_THERMAL_WRITABLE_TRIPS is whether or
not the writable trips mask passed during thermal zone registration
will take any effect, but whoever passes a non-zero writable trips mask
to thermal_zone_device_register_with_trips() can be forgiven thinking
that it will always work.

Moreover, some thermal drivers expect user space to set trip temperature
values, so they select CONFIG_THERMAL_WRITABLE_TRIPS, possibly overriding
a manual choice to unset it and going against the design purportedly
allowing system integrators to decide on the writability of trip points
for the given kernel build.  It is also set in one platform's defconfig.

Forthermore, CONFIG_THERMAL_WRITABLE_TRIPS only affects trip temperature,
because trip hysteresis is writable as long as the thermal zone provides
a callback to update it, regardless of the CONFIG_THERMAL_WRITABLE_TRIPS
value.

The above means that the symbol in question is used inconsistently and
its purpose is at least moot, so remove it and always take the writable
trip mask passed to thermal_zone_device_register_with_trips() into
account.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
arch/arm/configs/imx_v6_v7_defconfig
drivers/thermal/Kconfig
drivers/thermal/intel/Kconfig
drivers/thermal/thermal_sysfs.c

index 0a90583f9f017ed2f88cd20cb6f731440909e830..ae20dc002dcaf0e8f9ffdef1909b1c2833ff1057 100644 (file)
@@ -228,7 +228,6 @@ CONFIG_SENSORS_IIO_HWMON=y
 CONFIG_SENSORS_PWM_FAN=y
 CONFIG_SENSORS_SY7636A=y
 CONFIG_THERMAL_STATISTICS=y
-CONFIG_THERMAL_WRITABLE_TRIPS=y
 CONFIG_CPU_THERMAL=y
 CONFIG_IMX_THERMAL=y
 CONFIG_WATCHDOG=y
index 17a8ae5e991d0521a240cca01bea491cb5368115..204ed89a3ec9a77db24907b8a01f2e3a6acb8ea8 100644 (file)
@@ -83,17 +83,6 @@ config THERMAL_OF
          Say 'Y' here if you need to build thermal infrastructure
          based on device tree.
 
-config THERMAL_WRITABLE_TRIPS
-       bool "Enable writable trip points"
-       help
-         This option allows the system integrator to choose whether
-         trip temperatures can be changed from userspace. The
-         writable trips need to be specified when setting up the
-         thermal zone but the choice here takes precedence.
-
-         Say 'Y' here if you would like to allow userspace tools to
-         change trip temperatures.
-
 choice
        prompt "Default Thermal governor"
        default THERMAL_DEFAULT_GOV_STEP_WISE
index b43953b5539f6b718efbc4d8b180ba73a4668f8f..a31f2f32996afd712cba2836017e36889b09f655 100644 (file)
@@ -23,7 +23,6 @@ config X86_PKG_TEMP_THERMAL
        tristate "X86 package temperature thermal driver"
        depends on X86_THERMAL_VECTOR
        select THERMAL_GOV_USER_SPACE
-       select THERMAL_WRITABLE_TRIPS
        select INTEL_TCC
        default m
        help
@@ -47,7 +46,6 @@ config INTEL_SOC_DTS_THERMAL
        tristate "Intel SoCs DTS thermal driver"
        depends on X86 && PCI && ACPI
        select INTEL_SOC_DTS_IOSF_CORE
-       select THERMAL_WRITABLE_TRIPS
        help
          Enable this to register Intel SoCs (e.g. Bay Trail) platform digital
          temperature sensor (DTS). These SoCs have two additional DTSs in
index 2eace6b33b8cbfd278f34718792ba509433576bb..83914aa2248b67d47a96745da94ca161f7051e53 100644 (file)
@@ -458,8 +458,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
                                                tz->trip_temp_attrs[indx].name;
                tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO;
                tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show;
-               if (IS_ENABLED(CONFIG_THERMAL_WRITABLE_TRIPS) &&
-                   mask & (1 << indx)) {
+               if (mask & (1 << indx)) {
                        tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR;
                        tz->trip_temp_attrs[indx].attr.store =
                                                        trip_point_temp_store;