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]
Message-ID: <CAJZ5v0iT8w7APyNKDQ-Q-vO33-BN4_vh_HtiCxpCJZu_QzC4Ug@mail.gmail.com>
Date:   Tue, 19 Jul 2022 20:18:54 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Daniel Lezcano <daniel.lezcano@...exp.org>
Cc:     Daniel Lezcano <daniel.lezcano@...aro.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        "Zhang, Rui" <rui.zhang@...el.com>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Kevin Hilman <khilman@...libre.com>,
        Alexandre Bailon <abailon@...libre.com>,
        Lukasz Luba <lukasz.luba@....com>,
        Amit Kucheria <amitk@...nel.org>
Subject: Re: [PATCH v5 08/12] thermal/core: Add thermal_trip in thermal_zone

On Sun, Jul 10, 2022 at 2:35 PM Daniel Lezcano
<daniel.lezcano@...exp.org> wrote:
>
> The thermal trip points are properties of a thermal zone and the
> different sub systems should be able to save them in the thermal zone
> structure instead of having their own definition.
>
> Give the opportunity to the drivers to create a thermal zone with
> thermal trips which will be accessible directly from the thermal core
> framework.
>
> Cc: Alexandre Bailon <abailon@...libre.com>
> Cc: Kevin Hilman <khilman@...libre.com>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@...exp.org>
> ---
>  drivers/thermal/thermal_core.h | 10 ++++++++++
>  include/linux/thermal.h        |  2 ++
>  2 files changed, 12 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index c991bb290512..a4e730391cab 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -113,6 +113,16 @@ int thermal_build_list_of_policies(char *buf);
>  /* Helpers */
>  void thermal_zone_set_trips(struct thermal_zone_device *tz);
>
> +static inline struct thermal_trip *thermal_zone_get_trips(struct thermal_zone_device *tz)
> +{
> +       return tz->trips;
> +}
> +
> +static inline int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
> +{
> +       return tz->num_trips;
> +}

I'm not sure if these are really useful.

> +
>  /* sysfs I/F */
>  int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
>  void thermal_zone_destroy_device_groups(struct thermal_zone_device *);
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 03e968d61471..c7fcb9e2a4fc 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -125,6 +125,7 @@ struct thermal_cooling_device {
>   * @trip_hyst_attrs:   attributes for trip points for sysfs: trip hysteresis
>   * @mode:              current mode of this thermal zone
>   * @devdata:   private pointer for device private data
> + * @trips:     an array of struct thermal_trip
>   * @num_trips: number of trip points the thermal zone supports
>   * @trips_disabled;    bitmap for disabled trips
>   * @passive_delay_jiffies: number of jiffies to wait between polls when
> @@ -165,6 +166,7 @@ struct thermal_zone_device {
>         struct thermal_attr *trip_hyst_attrs;
>         enum thermal_device_mode mode;
>         void *devdata;
> +       struct thermal_trip *trips;

And I would fold this change into the patch introducing its first user.

>         int num_trips;
>         unsigned long trips_disabled;   /* bitmap for disabled trips */
>         unsigned long passive_delay_jiffies;
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ