linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Chris Down <chris@chrisdown.name>
Cc: linux-pm@vger.kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: Thermal notifications without setting thermal governor to userspace?
Date: Mon, 4 Apr 2022 18:17:59 +0200	[thread overview]
Message-ID: <8f1428c7-cf0e-b2cc-c898-09935a9017da@linaro.org> (raw)
In-Reply-To: <YksL8a+cINo7K/xX@chrisdown.name>


Hi Chris,

On 04/04/2022 17:17, Chris Down wrote:
> Hey Daniel,
> 
> Thanks a lot for getting back!
> 
> Daniel Lezcano writes:
>> For that it would require to setup a trip point from the firmware 
>> dedicated to userspace management along with the writable trip point 
>> kernel config option.
>>
>> On embedded systems, the trip point can be added easily in the device 
>> tree.
>>
>> You would end up with:
>>
>> - one passive trip point : writable and used by userspace
>>
>> - one passive trip point to protect the system tied with a cooling 
>> device and handled by the kernel
>>
>> - one hot trip point to notify the userspace critical is about to be 
>> reach
>>
>> - one critical trip point to reboot the system
>>
>> From the userspace, you change the trip temp to 50°C, 70°C and 90°C 
>> when crossing the way up or the way down.
>>
>> The sensor should implement the set_trip in order to program the 
>> register to fire the interrupt at the specified temperature. 
>> Otherwise, monitoring will be needed.
>>
>> On ACPI, except hacking the table and reload from the kernel I don't 
>> see how to do that.
> 
> In my case I'm dealing with "normal" desktop machines and a distribution 
> kernel, so it isn't possible to have fine grained control over the 
> kernel configuration or device tree (especially since ideally this would 
> be usable as an unprivileged user).
> 
> Is it still possible to use this in such a scenario?

Well on regular desktop, the thermal is managed under the hood by the 
firmware/hardware, few sensors are exported AFAICT. I don't think a 
thermal daemon would have a benefit on these platforms.

Anyway. The temperature is not moving so quickly with all the heat sinks 
on the desktop components usually, so monitoring the temperature with a 
pid loop and increase the sampling when getting closer to a temperature 
should be fine.

Just to clarify, userspace should not manage the thermal zones but the 
overall temperature by acting on the different heating sources' 
performance indexes.

Regarding the unprivileged access, it is not possible to act on the 
performance state of the different components for non-root users. It 
would require to setup the file capabilities for your program which is 
probably what you want.



-- 
<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

  reply	other threads:[~2022-04-04 21:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 15:45 Thermal notifications without setting thermal governor to userspace? Chris Down
2022-03-30 18:08 ` Daniel Lezcano
2022-03-30 18:11   ` Chris Down
2022-03-30 22:24 ` Daniel Lezcano
2022-04-04 15:17   ` Chris Down
2022-04-04 16:17     ` Daniel Lezcano [this message]
2022-04-04 17:17       ` Chris Down
2022-04-04 20:27         ` Daniel Lezcano
2022-04-04 20:50           ` Chris Down

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=8f1428c7-cf0e-b2cc-c898-09935a9017da@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=chris@chrisdown.name \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.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).