From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Wei Wang <wvw@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Wei Wang <wei.vince.wang@gmail.com>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
Amit Kucheria <amit.kucheria@verdurent.com>,
Linux PM list <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH v3 0/3] thermal: introduce by-name softlink
Date: Wed, 11 Dec 2019 22:11:36 +0100 [thread overview]
Message-ID: <f0ebc98d-25f2-6326-c0d8-8dda543c4091@linaro.org> (raw)
In-Reply-To: <CAGXk5yrFp1eeeadhJar_qJqJ9G1q2mn+5m8JW4705ouQDLqzsw@mail.gmail.com>
On 11/12/2019 21:11, Wei Wang wrote:
> On Wed, Dec 11, 2019 at 12:54 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
>>
>> On Tue, Dec 10, 2019 at 09:54:11PM +0100, Daniel Lezcano wrote:
>>> On 10/12/2019 21:01, Wei Wang wrote:
>>>> On Tue, Dec 10, 2019 at 6:36 AM Daniel Lezcano
>>>> <daniel.lezcano@linaro.org> wrote:
>>>>>
>>>>> On 05/12/2019 08:19, Wei Wang wrote:
>>>>>> The paths thermal_zone%d and cooling_device%d are not intuitive and the
>>>>>> numbers are subject to change due to device tree change. This usually
>>>>>> leads to tree traversal in userspace code.
>>
>> tree traversal is supposed to be done in userspace code :)
>>
> Yes, that can be done in userspace, but given the amount of thermal
> zones we have in some mobile devices, this will bring a lot of
> convenience.
But usually all these thermal zones are fixed and building the name<->tz
association is just a question of a few lines of code from userspace,
no? What would be the benefit of adding more ABI?
If there is a thermal zone change, then a notification can be used, so
the userspace code rebuild the name<->tz, no?
> e.g. this is on Pixel 4 XL:
> coral:/ # ls /sys/devices/virtual/thermal/
> cdev-by-name cooling_device15 cooling_device22 cooling_device3
> cooling_device9 thermal_zone15 thermal_zone22 thermal_zone3
> thermal_zone37 thermal_zone44 thermal_zone51 thermal_zone59
> thermal_zone66 thermal_zone73 thermal_zone80 thermal_zone88
> cooling_device0 cooling_device16 cooling_device23 cooling_device30
> thermal_zone0 thermal_zone16 thermal_zone23 thermal_zone30
> thermal_zone38 thermal_zone45 thermal_zone52 thermal_zone6
> thermal_zone67 thermal_zone74 thermal_zone81 thermal_zone9
> cooling_device1 cooling_device17 cooling_device24 cooling_device31
> thermal_zone1 thermal_zone17 thermal_zone24 thermal_zone31
> thermal_zone39 thermal_zone46 thermal_zone53 thermal_zone60
> thermal_zone68 thermal_zone75 thermal_zone82 tz-by-name
> cooling_device10 cooling_device18 cooling_device25 cooling_device4
> thermal_zone10 thermal_zone18 thermal_zone25 thermal_zone32
> thermal_zone4 thermal_zone47 thermal_zone54 thermal_zone61
> thermal_zone69 thermal_zone76 thermal_zone83
> cooling_device11 cooling_device19 cooling_device26 cooling_device5
> thermal_zone11 thermal_zone19 thermal_zone26 thermal_zone33
> thermal_zone40 thermal_zone48 thermal_zone55 thermal_zone62
> thermal_zone7 thermal_zone77 thermal_zone84
> cooling_device12 cooling_device2 cooling_device27 cooling_device6
> thermal_zone12 thermal_zone2 thermal_zone27 thermal_zone34
> thermal_zone41 thermal_zone49 thermal_zone56 thermal_zone63
> thermal_zone70 thermal_zone78 thermal_zone85
> cooling_device13 cooling_device20 cooling_device28 cooling_device7
> thermal_zone13 thermal_zone20 thermal_zone28 thermal_zone35
> thermal_zone42 thermal_zone5 thermal_zone57 thermal_zone64
> thermal_zone71 thermal_zone79 thermal_zone86
> cooling_device14 cooling_device21 cooling_device29 cooling_device8
> thermal_zone14 thermal_zone21 thermal_zone29 thermal_zone36
> thermal_zone43 thermal_zone50 thermal_zone58 thermal_zone65
> thermal_zone72 thermal_zone8 thermal_zone87
>
>
>> But what userspace code needs to do this, and for what?
> In Android, thermal daemon and thermal HAL as well as some init.rc
> script would use those thermal paths for managing and monitoring
> thermal. The daemon/HAL could have logic pipled in, however Android's
> init.rc script would be really tricky.
> On a related note, we also create /dev/block/by-name links from userspace.
>
> Thanks!
> -Wei
>>
>> thanks,
>>
>> greg k-h
--
<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
next prev parent reply other threads:[~2019-12-11 21:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 7:19 [PATCH v3 0/3] thermal: introduce by-name softlink Wei Wang
2019-12-05 7:19 ` [PATCH v3 1/3] thermal: prevent cooling device with no type to be registered Wei Wang
2019-12-09 7:41 ` Amit Kucheria
2019-12-09 17:34 ` Wei Wang
2019-12-09 19:36 ` Daniel Lezcano
2019-12-09 21:13 ` Wei Wang
2019-12-05 7:19 ` [PATCH v3 2/3] thermal: improve error message in thermal zone registration Wei Wang
2019-12-09 7:41 ` Amit Kucheria
2019-12-05 7:19 ` [PATCH v3 3/3] thermal: create softlink by name for thermal_zone and cooling_device Wei Wang
2019-12-06 19:15 ` Matthias Kaehlcke
2019-12-09 7:42 ` Amit Kucheria
2019-12-10 14:36 ` [PATCH v3 0/3] thermal: introduce by-name softlink Daniel Lezcano
2019-12-10 20:01 ` Wei Wang
2019-12-10 20:54 ` Daniel Lezcano
2019-12-11 8:53 ` Greg Kroah-Hartman
2019-12-11 8:54 ` Greg Kroah-Hartman
2019-12-11 20:11 ` Wei Wang
2019-12-11 21:11 ` Daniel Lezcano [this message]
2019-12-11 22:19 ` Wei Wang
2019-12-15 16:34 ` Sandeep Patil
2019-12-16 17:37 ` Wei Wang
2019-12-12 7:34 ` Greg Kroah-Hartman
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=f0ebc98d-25f2-6326-c0d8-8dda543c4091@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=amit.kucheria@verdurent.com \
--cc=edubezval@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=wei.vince.wang@gmail.com \
--cc=wvw@google.com \
/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).