From: Icenowy Zheng <uwu@icenowy.me>
To: Chen-Yu Tsai <wenst@chromium.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Mark Brown <broonie@kernel.org>, Amit Kucheria <amitk@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH RESEND RESEND] thermal/of: support thermal zones w/o trips subnode
Date: Tue, 01 Aug 2023 22:10:34 +0800 [thread overview]
Message-ID: <c0ccb3021324883fce5d87e27f5abdcccc96503a.camel@icenowy.me> (raw)
In-Reply-To: <20230724042502.GA2403526@google.com>
在 2023-07-24星期一的 12:25 +0800,Chen-Yu Tsai写道:
> On Sun, Jul 23, 2023 at 12:12:49PM +0200, Daniel Lezcano wrote:
> >
> > 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@icenowy.me>
> > > >
> > > > 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.
>
> Not really. It was made optional in the v5.15 kernel release by
> commit
>
> 22fc857538c3 dt-bindings: thermal: Make trips node optional
I agree, this is why I send this patch (and why I say 'for DT binding
compatibility now' in the commit message). Further discussion could be
performed, but this patch should be applied regardless of the result of
further discussion.
DT binding compatibility is the unbreakable law.
>
> > 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.
>
> What about thermal sensors with multiple channels? Some of the
> channels
> are indeed tied to important hardware blocks like the CPU cores and
> should be tied into the thermal tripping. However other channels
> might
> only be used for temperature read-out and have no such requirement.
>
> Should we be mixing thermal and hwmon APIs in the driver?
Well you have no right to decide which sensor should be used for
throttling and which not. So the only way to make the semantic correct
is just rip every sensor driver out of thermal API to hwmon API, and
let thermal framework to use hwmon's.
>
> > 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
>
> for measurement points that are used for thermal throttling /
> mitigation.
>
> ChenYu
>
_______________________________________________
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:[~2023-08-01 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-22 12:25 [PATCH RESEND RESEND] thermal/of: support thermal zones w/o trips subnode Icenowy Zheng
2023-07-22 20:11 ` Mark Brown
2023-07-23 10:12 ` Daniel Lezcano
[not found] ` <20230724042502.GA2403526@google.com>
2023-08-01 14:10 ` Icenowy Zheng [this message]
2023-08-16 10:04 ` Daniel Lezcano
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=c0ccb3021324883fce5d87e27f5abdcccc96503a.camel@icenowy.me \
--to=uwu@icenowy.me \
--cc=amitk@kernel.org \
--cc=broonie@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=rui.zhang@intel.com \
--cc=wenst@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;
as well as URLs for NNTP newsgroup(s).