thermal: setup monitor only once after handling trips
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
@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)handle_critical_trips (tz, trip, type); elsehandle_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
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.
Cc Zhang Rui <[email protected]>Signed-off-by Eduardo Valentin <[email protected]>--- drivers/thermal/thermal_core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/thermal/thermal_core.c +0
-5@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)handle_critical_trips (tz, trip, type); elsehandle_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
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.
Cc Zhang Rui <[email protected]>Signed-off-by Eduardo Valentin <[email protected]>--- drivers/thermal/thermal_core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/thermal/thermal_core.c +0
-5@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)handle_critical_trips (tz, trip, type); elsehandle_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
-0for (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_frameworkmight 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