Re: [PATCH RESEND RESEND] thermal/of: support thermal zones w/o trips subnode

From: Daniel Lezcano
Date: Sun Jul 23 2023 - 06:19:37 EST



Hi Mark,

On 22/07/2023 22:11, Mark Brown wrote:
On Sat, Jul 22, 2023 at 08:25:34PM +0800, Icenowy Zheng wrote:
From: Icenowy Zheng <uwu@xxxxxxxxxx>

Although the current device tree binding of thermal zones require the
trips subnode, the binding in kernel v5.15 does not require it, and many
device trees shipped with the kernel, for example,
allwinner/sun50i-a64.dtsi and mediatek/mt8183-kukui.dtsi in ARM64, still
comply to the old binding and contain no trips subnode.

Allow the code to successfully register thermal zones w/o trips subnode
for DT binding compatibility now.

Furtherly, the inconsistency between DTs and bindings should be resolved
by either adding empty trips subnode or dropping the trips subnode
requirement.

This makes sense to me - it allows people to see the reported
temperature even if there's no trips defined which seems more
helpful than refusing to register.

The binding describes the trip points as required and that since the beginning.

What changed is now the code reflects the required property while before it was permissive, that was an oversight.

Just a reminder about the thermal framework goals:

1. It protects the silicon (thus critical and hot trip points)

2. It mitigates the temperature (thus cooling device bound to trip points)

3. It notifies the userspace when a trip point is crossed

So if the thermal zone is described but without any of this goal above, it is pointless.

If the goal is to report the temperature only, then hwmon should be used instead.

If the goal is to mitigate by userspace, then the trip point *must* be used to prevent the userspace polling the temperature. With the trip point the sensor will be set to fire an interrupt at the given trip temperature.

IOW, trip points are not optional



--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog