Skip to content

Commit 2ae0998

Browse files
committed
thermal: core: Relocate critical and hot trip handling
Modify handle_thermal_trip() to call handle_critical_trips() only after finding that the trip temperature has been crossed on the way up and remove the redundant temperature check from the latter. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
1 parent ad2f8bc commit 2ae0998

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/thermal/thermal_core.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,6 @@ void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz)
350350
static void handle_critical_trips(struct thermal_zone_device *tz,
351351
const struct thermal_trip *trip)
352352
{
353-
/* If we have not crossed the trip_temp, we do not care. */
354-
if (trip->temperature <= 0 || tz->temperature < trip->temperature)
355-
return;
356-
357353
trace_thermal_zone_trip(tz, thermal_zone_trip_id(tz, trip), trip->type);
358354

359355
if (trip->type == THERMAL_TRIP_CRITICAL)
@@ -405,10 +401,11 @@ static void handle_thermal_trip(struct thermal_zone_device *tz,
405401
list_add_tail(&td->notify_list_node, way_up_list);
406402
td->notify_temp = trip->temperature;
407403
td->threshold -= trip->hysteresis;
408-
}
409404

410-
if (trip->type == THERMAL_TRIP_CRITICAL || trip->type == THERMAL_TRIP_HOT)
411-
handle_critical_trips(tz, trip);
405+
if (trip->type == THERMAL_TRIP_CRITICAL ||
406+
trip->type == THERMAL_TRIP_HOT)
407+
handle_critical_trips(tz, trip);
408+
}
412409
}
413410

414411
static void update_temperature(struct thermal_zone_device *tz)

0 commit comments

Comments
 (0)