thermal/core: Deprecate changing cooling device state from userspace
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 19 Oct 2021 16:35:06 +0000 (18:35 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 21 Oct 2021 15:35:11 +0000 (17:35 +0200)
commita67a46af4ad6342378e332b7420c1d1a2818c53f
tree054057ba09e0dc5ec908ad6685c55def09f9d070
parent0275c9fb0eff3f77d437ab8a95b16e6f8f80b7f2
thermal/core: Deprecate changing cooling device state from userspace

The cooling devices have their cooling device set_cur_state
read-writable all the time in the sysfs directory, thus allowing the
userspace to act on it.

The thermal framework is wrongly used by userspace as a power capping
framework by acting on the cooling device opaque state. This one then
competes with the in-kernel governor decision.

We have seen in out-of-tree kernels, a big number of devices which are
abusely declaring themselves as cooling device just to act on their
power.

The role of the thermal framework is to protect the junction
temperature of the silicon. Letting the userspace to play with a
cooling device is invalid and potentially dangerous.

The powercap framework is the right framework to do power capping and
moreover it deals with the aggregation via the dev pm qos.

As the userspace governor is marked deprecated and about to be
removed, there is no point to keep this file writable also in the
future.

Emit a warning and deprecate the interface.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://lore.kernel.org/r/20211019163506.2831454-2-daniel.lezcano@linaro.org
drivers/thermal/thermal_sysfs.c