Linux Power Management development
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	"open list:THERMAL" <linux-pm@vger.kernel.org>
Subject: Re: [RFC PATCH] thermal/core: Fix trip point crossing events ordering
Date: Wed, 6 Mar 2024 14:16:21 +0100	[thread overview]
Message-ID: <0e7f32aa-b2c3-43d0-8ebe-7118cb6e0edf@linaro.org> (raw)
In-Reply-To: <CAJZ5v0j6At1DuQYjjbA-fw9Z-jJPhXSVSz=_uLa3KfNMJowYbA@mail.gmail.com>

On 06/03/2024 13:53, Rafael J. Wysocki wrote:
> On Wed, Mar 6, 2024 at 1:43 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>>
>> On 06/03/2024 13:02, Rafael J. Wysocki wrote:
>>
>> [ ... ]
>>
>>>> +#define for_each_trip_reverse(__tz, __trip)    \
>>>> +       for (__trip = &__tz->trips[__tz->num_trips - 1]; __trip >= __tz->trips ; __trip--)
>>>> +
>>>>    void __thermal_zone_set_trips(struct thermal_zone_device *tz);
>>>>    int thermal_zone_trip_id(const struct thermal_zone_device *tz,
>>>>                            const struct thermal_trip *trip);
>>>> --
>>>
>>> Generally speaking, this is a matter of getting alignment on the
>>> expectations between the kernel and user space.
>>>
>>> It looks like user space expects to get the notifications in the order
>>> of either growing or falling temperatures, depending on the direction
>>> of the temperature change.  Ordering the trips in the kernel is not
>>> practical, but the notifications can be ordered in principle.  Is this
>>> what you'd like to do?
>>
>> Yes
>>
>>> Or can user space be bothered with recognizing that it may get the
>>> notifications for different trips out of order?
>>
>> IMO it is a bad information if the trip points events are coming
>> unordered. The temperature signal is a time related measurements, the
>> userspace should receive thermal information from this signal in the
>> right order. It sounds strange to track the temperature signal in the
>> kernel, then scramble the information, pass it to the userspace and
>> except it to apply some kind of logic to unscramble it.
> 
> So the notifications can be ordered before sending them out, as long
> as they are produced by a single __thermal_zone_device_update() call.
> 
> I guess you also would like the thermal_debug_tz_trip_up/down() calls
> to be ordered, wouldn't you?

Right

-- 
<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:[~2024-03-06 13:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  8:54 [RFC PATCH] thermal/core: Fix trip point crossing events ordering Daniel Lezcano
2024-03-06 12:02 ` Rafael J. Wysocki
2024-03-06 12:43   ` Daniel Lezcano
2024-03-06 12:53     ` Rafael J. Wysocki
2024-03-06 13:16       ` Daniel Lezcano [this message]
2024-03-06 15:41         ` Rafael J. Wysocki
2024-03-06 15:55           ` Daniel Lezcano
2024-03-06 19:32             ` Rafael J. Wysocki
2024-03-07 11:38               ` Rafael J. Wysocki

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=0e7f32aa-b2c3-43d0-8ebe-7118cb6e0edf@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --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