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:   Fri, 5 Nov 2021 16:22:52 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Manaf Meethalavalappu Pallikunhi <manafm@...eaurora.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     Zhang Rui <rui.zhang@...el.com>, Amit Kucheria <amitk@...nel.org>,
        Thara Gopinath <thara.gopinath@...aro.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers: thermal: Reset previous low and high trip during
 thermal zone init

On Tue, Nov 2, 2021 at 9:01 PM Manaf Meethalavalappu Pallikunhi
<manafm@...eaurora.org> wrote:
>
> During the suspend is in process, thermal_zone_device_update bails out
> thermal zone re-evaluation for any sensor trip violation without
> setting next valid trip to that sensor. It assumes during resume
> it will re-evaluate same thermal zone and update trip. But when it is
> in suspend temperature goes down and on resume path while updating
> thermal zone if temperature is less than previously violated trip,
> thermal zone set trip function evaluates the same previous high and
> previous low trip as new high and low trip. Since there is no change
> in high/low trip, it bails out from thermal zone set trip API without
> setting any trip. It leads to a case where sensor high trip or low
> trip is disabled forever even though thermal zone has a valid high
> or low trip.
>
> During thermal zone device init, reset thermal zone previous high
> and low trip. It resolves above mentioned scenario.

Makes sense to me.

Daniel?

> Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@...eaurora.org>
> ---
>  drivers/thermal/thermal_core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 21db445..2b7a0b4 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -477,6 +477,8 @@ static void thermal_zone_device_init(struct thermal_zone_device *tz)
>  {
>         struct thermal_instance *pos;
>         tz->temperature = THERMAL_TEMP_INVALID;
> +       tz->prev_low_trip = -INT_MAX;

Why not use INT_MIN instead?

> +       tz->prev_high_trip = INT_MAX;
>         list_for_each_entry(pos, &tz->thermal_instances, tz_node)
>                 pos->initialized = false;
>  }
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ