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: <b01cdc80-b644-40ee-ae24-559a95e2d2c9@arm.com>
Date: Thu, 24 Oct 2024 11:25:37 +0100
From: Lukasz Luba <lukasz.luba@....com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: LKML <linux-kernel@...r.kernel.org>, Linux PM <linux-pm@...r.kernel.org>,
 Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>,
 Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [PATCH v1 07/10] thermal: core: Relocate functions that update
 trip points



On 10/16/24 12:32, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> In preparation for subsequent changes, move two functions used
> for updating trip points, thermal_zone_set_trip_temp() and
> thermal_zone_set_trip_hyst(), to thermal_core.c.
> 
> No functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>   drivers/thermal/thermal_core.c |   35 +++++++++++++++++++++++++++++++++++
>   drivers/thermal/thermal_trip.c |   35 -----------------------------------
>   2 files changed, 35 insertions(+), 35 deletions(-)
> 
> Index: linux-pm/drivers/thermal/thermal_core.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.c
> +++ linux-pm/drivers/thermal/thermal_core.c
> @@ -541,6 +541,41 @@ static void thermal_trip_crossed(struct
>   	thermal_governor_trip_crossed(governor, tz, trip, crossed_up);
>   }
>   
> +void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
> +				struct thermal_trip *trip, int hyst)
> +{
> +	WRITE_ONCE(trip->hysteresis, hyst);
> +	thermal_notify_tz_trip_change(tz, trip);
> +}
> +
> +void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
> +				struct thermal_trip *trip, int temp)
> +{
> +	if (trip->temperature == temp)
> +		return;
> +
> +	WRITE_ONCE(trip->temperature, temp);
> +	thermal_notify_tz_trip_change(tz, trip);
> +
> +	if (temp == THERMAL_TEMP_INVALID) {
> +		struct thermal_trip_desc *td = trip_to_trip_desc(trip);
> +
> +		/*
> +		 * If the trip has been crossed on the way up, some adjustments
> +		 * are needed to compensate for the lack of it going forward.
> +		 */
> +		if (tz->temperature >= td->threshold)
> +			thermal_zone_trip_down(tz, td);
> +
> +		/*
> +		 * Invalidate the threshold to avoid triggering a spurious
> +		 * trip crossing notification when the trip becomes valid.
> +		 */
> +		td->threshold = INT_MAX;
> +	}
> +}
> +EXPORT_SYMBOL_GPL(thermal_zone_set_trip_temp);
> +
>   void __thermal_zone_device_update(struct thermal_zone_device *tz,
>   				  enum thermal_notify_event event)
>   {
> Index: linux-pm/drivers/thermal/thermal_trip.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_trip.c
> +++ linux-pm/drivers/thermal/thermal_trip.c
> @@ -88,38 +88,3 @@ int thermal_zone_trip_id(const struct th
>   	 */
>   	return trip_to_trip_desc(trip) - tz->trips;
>   }
> -
> -void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
> -				struct thermal_trip *trip, int hyst)
> -{
> -	WRITE_ONCE(trip->hysteresis, hyst);
> -	thermal_notify_tz_trip_change(tz, trip);
> -}
> -
> -void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
> -				struct thermal_trip *trip, int temp)
> -{
> -	if (trip->temperature == temp)
> -		return;
> -
> -	WRITE_ONCE(trip->temperature, temp);
> -	thermal_notify_tz_trip_change(tz, trip);
> -
> -	if (temp == THERMAL_TEMP_INVALID) {
> -		struct thermal_trip_desc *td = trip_to_trip_desc(trip);
> -
> -		/*
> -		 * If the trip has been crossed on the way up, some adjustments
> -		 * are needed to compensate for the lack of it going forward.
> -		 */
> -		if (tz->temperature >= td->threshold)
> -			thermal_zone_trip_down(tz, td);
> -
> -		/*
> -		 * Invalidate the threshold to avoid triggering a spurious
> -		 * trip crossing notification when the trip becomes valid.
> -		 */
> -		td->threshold = INT_MAX;
> -	}
> -}
> -EXPORT_SYMBOL_GPL(thermal_zone_set_trip_temp);
> 
> 
> 


Reviewed-by: Lukasz Luba <lukasz.luba@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ