Skip to content

Commit 9662756

Browse files
committed
thermal/core: Rearm the monitoring only one time
The current code calls monitor_thermal_zone() inside the handle_thermal_trip() function. But this one is called in a loop for each trip point which means the monitoring is rearmed several times for nothing (assuming there could be several passive and active trip points). Move the monitor_thermal_zone() function out of the handle_thermal_trip() function and after the thermal trip loop, so the timer will be disabled or rearmed one time. Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e920209 commit 9662756

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/thermal/thermal_core.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
383383
handle_critical_trips(tz, trip, trip_temp, type);
384384
else
385385
handle_non_critical_trips(tz, trip);
386-
/*
387-
* Alright, we handled this trip successfully.
388-
* So, start monitoring again.
389-
*/
390-
monitor_thermal_zone(tz);
391386
}
392387

393388
static void update_temperature(struct thermal_zone_device *tz)
@@ -503,6 +498,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
503498

504499
for (count = 0; count < tz->num_trips; count++)
505500
handle_thermal_trip(tz, count);
501+
502+
monitor_thermal_zone(tz);
506503
}
507504
EXPORT_SYMBOL_GPL(thermal_zone_device_update);
508505

0 commit comments

Comments
 (0)