lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Jul 2022 13:40:34 +0100
From:   Lukasz Luba <lukasz.luba@....com>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     quic_manafm@...cinc.com, rui.zhang@...el.com,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Amit Kucheria <amitk@...nel.org>, rafael@...nel.org
Subject: Re: [PATCH v2 3/3] thermal/core: Fix thermal trip cross point



On 7/12/22 13:30, Daniel Lezcano wrote:
> 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.
> 
> 

Sounds a reliable way to move forward. Maybe you could just sort in the
right order those trip points in the thermal_of_build_thermal_zone()
in an additional patch to this series?
Than this patch could stay as is, because it looks good.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ