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 22:27:43 +0200	[thread overview]
Message-ID: <e9d0f787-b23e-1266-c31a-60f9c1643a10@linaro.org> (raw)
In-Reply-To: <YksoQ62CObN1R/oG@chrisdown.name>

On 04/04/2022 19:17, Chris Down wrote:
> Daniel Lezcano writes:
>> 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.
> 
> Maybe we have different expectations? On my laptop, a Thinkpad T14s, 
> things seem not too bad:

That is not a desktop but a laptop, it is different :)

Can you give the content of:

cat /sys/class/thermal/thermal_zone*/type
cat /sys/class/thermal/thermal_zone*/trip_*type

and

cat /sys/class/thermal/cooling_device*/type

?


>      % printf '%s\n' /sys/class/hwmon/hwmon*/temp*_input
>      /sys/class/hwmon/hwmon1/temp1_input
>      /sys/class/hwmon/hwmon2/temp1_input
>      /sys/class/hwmon/hwmon2/temp2_input
>      /sys/class/hwmon/hwmon2/temp3_input
>      /sys/class/hwmon/hwmon4/temp1_input
>      /sys/class/hwmon/hwmon4/temp2_input
>      /sys/class/hwmon/hwmon4/temp3_input
>      /sys/class/hwmon/hwmon4/temp4_input
>      /sys/class/hwmon/hwmon4/temp5_input
>      /sys/class/hwmon/hwmon4/temp6_input
>      /sys/class/hwmon/hwmon4/temp7_input
>      /sys/class/hwmon/hwmon4/temp8_input
>      /sys/class/hwmon/hwmon6/temp1_input
>      /sys/class/hwmon/hwmon8/temp1_input
>      /sys/class/hwmon/hwmon8/temp2_input
>      /sys/class/hwmon/hwmon8/temp3_input
>      /sys/class/hwmon/hwmon8/temp4_input
>      /sys/class/hwmon/hwmon8/temp5_input
> 
> There are working temperature sensors out of the box for the CPU, wifi 
> card, ACPI thermal zone, and extended sensors from thinkpad_acpi.
> 
> In my case, I'd like to get notifications in userspace when certain 
> temperatures are reached.
> 
> So if I understood correctly, there's no way to dynamically configure 
> temperature thresholds and get breach events even as root, even with the 
> new netlink solution?

There is a way but you need:

1. A programmable trip point

 
https://uefi.org/specs/ACPI/6.4/11_Thermal_Management/thermal-control.html#dynamically-changing-cooling-temperature-trip-points

1.1 A passive trip point dedicated for userspace (no cooling device 
associated)

1.2 Writable kernel config option

The trip point will be writable in sysfs

2. Get trip point crossed

Use the netlink

But you don't need to monitor all these thermal zones, it is up to the 
in-kernel thermal framework to deal with the trip point individually and 
protect the system.

The userspace should monitor what is considered as the 'case' sensor or 
'skin' sensor. The temperature on those sensor moves very slowly, so 
monitoring them by getting the temperature every second should be enough.



-- 
<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
2022-04-04 17:17       ` Chris Down
2022-04-04 20:27         ` Daniel Lezcano [this message]
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=e9d0f787-b23e-1266-c31a-60f9c1643a10@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).