mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: quic_manafm@quicinc.com, rui.zhang@intel.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Amit Kucheria <amitk@kernel.org>,
	rafael@kernel.org
Subject: Re: [PATCH v2 3/3] thermal/core: Fix thermal trip cross point
Date: Tue, 12 Jul 2022 14:30:54 +0200	[thread overview]
Message-ID: <2d680cd9-9e97-e06c-55c2-2a3a1504488e@linaro.org> (raw)
In-Reply-To: <6ce87fbb-1460-503b-f1f1-8cf53e702cdf@arm.com>

On 12/07/2022 13:29, Lukasz Luba wrote:

[ ... ]

>> @@ -511,8 +528,13 @@ void thermal_zone_device_update(struct 
>> thermal_zone_device *tz,
>>       tz->notify_event = event;
>> -    for (count = 0; count < tz->trips; count++)
>> -        handle_thermal_trip(tz, count);
>> +    if (tz->last_temperature <= tz->temperature) {
>> +        for (count = 0; count < tz->trips; count++)
>> +            handle_thermal_trip(tz, count);
>> +    } else {
>> +        for (count = tz->prev_trip; count >= 0; count--)
>> +            handle_thermal_trip(tz, count);
>> +    }
> 
> In general the code look good. I have one question, though:
> Is it always true that these trip points coming from the DT
> and parsed in thermal_of_build_thermal_zone() populated by
>      for_each_child_of_node(child, gchild) {
>           thermal_of_populate_trip(gchild, &tz->trips[i++]);
> 
> are always defined in right order in DT?

Hmm, that is a good question. Even if the convention is to put the trip 
point in the ascending order, I don't find any documentation telling it 
is mandatory. Given that I don't feel particularly comfortable to assume 
that is the case.

Perhaps, it would make more sense to build a map of indexes telling the 
order in the trip points and work with it instead.


-- 
<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-07-12 12:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 18:32 [PATCH v2 1/3] thermal/core: Encapsulate the trip point crossed function Daniel Lezcano
2022-07-08 18:32 ` [PATCH v2 2/3] thermal/core: Passing a parameter instead of calling the function again Daniel Lezcano
2022-07-12 11:14   ` Lukasz Luba
2022-07-12 18:16   ` Rafael J. Wysocki
2022-07-08 18:32 ` [PATCH v2 3/3] thermal/core: Fix thermal trip cross point Daniel Lezcano
2022-07-12 11:29   ` Lukasz Luba
2022-07-12 12:30     ` Daniel Lezcano [this message]
2022-07-12 12:40       ` Lukasz Luba
2022-07-12 13:06         ` Daniel Lezcano
2022-07-12 14:28           ` Lukasz Luba
2022-07-12 10:37 ` [PATCH v2 1/3] thermal/core: Encapsulate the trip point crossed function Daniel Lezcano
2022-07-12 11:13 ` Lukasz Luba

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=2d680cd9-9e97-e06c-55c2-2a3a1504488e@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=quic_manafm@quicinc.com \
    --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

all inboxes | Powered by JetHome®