Skip to contentSkip to conversation

thermal: setup monitor only once after handling trips

PATCH Superseded Eduardo Valentin 2 participants 3 messages Nov 25, 2015 – Nov 30, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: setup monitor only once after handling trips

Instead of changing the monitoring setup every time after handling each trip, this patch simplifies the monitoring setup by moving the setup call to a place where all trips have been treated already.

---
 drivers/thermal/thermal_core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/thermal/thermal_core.c +6 -5
index d9e525c..6debb54 100644
@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
 		handle_critical_trips(tz, trip, type);
 	else
 		handle_non_critical_trips(tz, trip, type);
-	/*
-	 * Alright, we handled this trip successfully.
-	 * So, start monitoring again.
-	 */
-	monitor_thermal_zone(tz);
 }
 
 /**
@@ -547,6 +542,12 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
 
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
+
+	/*
+	 * Alright, we handled this trip successfully.
+	 * So, start monitoring again.
+	 */
+	monitor_thermal_zone(tz);
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 
Signature · 1 line
2.5.0
#1 lore raw

Hi,

Quoted 30 lines · Eduardo Valentin

Instead of changing the monitoring setup every time after handling each trip, this patch simplifies the monitoring setup by moving the setup call to a place where all trips have been treated already.

---
 drivers/thermal/thermal_core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/thermal/thermal_core.c +0 -5
index d9e525c..6debb54 100644
@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
 		handle_critical_trips(tz, trip, type);
 	else
 		handle_non_critical_trips(tz, trip, type);
-	/*
-	 * Alright, we handled this trip successfully.
-	 * So, start monitoring again.
-	 */
-	monitor_thermal_zone(tz);
 }
 
 /**

drivers/thermal/thermal_core.c void thermal_zone_device_update(struct thermal_zone_device *tz) · line 547

Quoted 6 lines
drivers/thermal/thermal_core.c +3 -0
@@ -547,6 +542,12 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
 
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
+
+	/*
+	 * Alright, we handled this trip successfully.

s/these trips ?

drivers/thermal/thermal_core.c void thermal_zone_device_update(struct thermal_zone_device *tz) · line 553

Quoted 6 lines
drivers/thermal/thermal_core.c +3 -0
+	 * So, start monitoring again.
+	 */
+	monitor_thermal_zone(tz);
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 

BTW, thermal_notify_framework might need be affected?

thanks,
Yu

#2 lore raw
Quoted 33 lines · Yu C

Hi,

Quoted 31 lines · Eduardo Valentin

Instead of changing the monitoring setup every time after handling each trip, this patch simplifies the monitoring setup by moving the setup call to a place where all trips have been treated already.

---
 drivers/thermal/thermal_core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/thermal/thermal_core.c +0 -5
index d9e525c..6debb54 100644
@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
 		handle_critical_trips(tz, trip, type);
 	else
 		handle_non_critical_trips(tz, trip, type);
-	/*
-	 * Alright, we handled this trip successfully.
-	 * So, start monitoring again.
-	 */
-	monitor_thermal_zone(tz);
 }
 
 /**
@@ -547,6 +542,12 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
 
Quoted 6 lines

drivers/thermal/thermal_core.c void thermal_zone_device_update(struct thermal_zone_device *tz) · line 547

Quoted 5 lines
drivers/thermal/thermal_core.c +3 -0
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
+
+	/*
+	 * Alright, we handled this trip successfully.

s/these trips ?

Yeah, I can amend this.

Quoted 7 lines

drivers/thermal/thermal_core.c void thermal_zone_device_update(struct thermal_zone_device *tz) · line 553

Quoted 6 lines
drivers/thermal/thermal_core.c +3 -0
+	 * So, start monitoring again.
+	 */
+	monitor_thermal_zone(tz);
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 

BTW, thermal_notify_framework might need be affected?

Well, the original code does not call thermal_notify_framework. Calling it would require a different patch. This one is just to simplify the monitoring setup.

BR,

Quoted 3 lines

thanks,
Yu