diff mbox series

[v1,04/10] thermal: core: Rearrange __thermal_zone_device_update()

Message ID 3323276.44csPzL39Z@rjwysocki.net (mailing list archive)
State Queued
Delegated to: Rafael Wysocki
Headers show
Series thermal: core: Use lists of trips for trip crossing detection and handling | expand

Commit Message

Rafael J. Wysocki Oct. 16, 2024, 11:26 a.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

In preparation for subsequent changes, move the invocations of
thermal_thresholds_handle() and thermal_zone_set_trips() in
__thermal_zone_device_update() after the processing of the
temporary trip lists.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/thermal/thermal_core.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Lukasz Luba Oct. 24, 2024, 10:20 a.m. UTC | #1
On 10/16/24 12:26, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> In preparation for subsequent changes, move the invocations of
> thermal_thresholds_handle() and thermal_zone_set_trips() in
> __thermal_zone_device_update() after the processing of the
> temporary trip lists.
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>   drivers/thermal/thermal_core.c |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Index: linux-pm/drivers/thermal/thermal_core.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.c
> +++ linux-pm/drivers/thermal/thermal_core.c
> @@ -588,10 +588,6 @@ void __thermal_zone_device_update(struct
>   			high = td->threshold;
>   	}
>   
> -	thermal_thresholds_handle(tz, &low, &high);
> -
> -	thermal_zone_set_trips(tz, low, high);
> -
>   	list_for_each_entry_safe(td, next, &way_up_list, list_node) {
>   		thermal_trip_crossed(tz, &td->trip, governor, true);
>   		list_del_init(&td->list_node);
> @@ -602,6 +598,10 @@ void __thermal_zone_device_update(struct
>   		list_del_init(&td->list_node);
>   	}
>   
> +	thermal_thresholds_handle(tz, &low, &high);
> +
> +	thermal_zone_set_trips(tz, low, high);
> +
>   	if (governor->manage)
>   		governor->manage(tz);
>   
> 
> 
> 


Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
diff mbox series

Patch

Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -588,10 +588,6 @@  void __thermal_zone_device_update(struct
 			high = td->threshold;
 	}
 
-	thermal_thresholds_handle(tz, &low, &high);
-
-	thermal_zone_set_trips(tz, low, high);
-
 	list_for_each_entry_safe(td, next, &way_up_list, list_node) {
 		thermal_trip_crossed(tz, &td->trip, governor, true);
 		list_del_init(&td->list_node);
@@ -602,6 +598,10 @@  void __thermal_zone_device_update(struct
 		list_del_init(&td->list_node);
 	}
 
+	thermal_thresholds_handle(tz, &low, &high);
+
+	thermal_zone_set_trips(tz, low, high);
+
 	if (governor->manage)
 		governor->manage(tz);