File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -1648,6 +1648,7 @@ static void thermal_zone_device_resume(struct work_struct *work)
1648
1648
1649
1649
tz -> suspended = false;
1650
1650
1651
+ thermal_debug_tz_resume (tz );
1651
1652
thermal_zone_device_init (tz );
1652
1653
__thermal_zone_device_update (tz , THERMAL_EVENT_UNSPECIFIED );
1653
1654
Original file line number Diff line number Diff line change @@ -926,3 +926,39 @@ void thermal_debug_tz_remove(struct thermal_zone_device *tz)
926
926
thermal_debugfs_remove_id (thermal_dbg );
927
927
kfree (trips_crossed );
928
928
}
929
+
930
+ void thermal_debug_tz_resume (struct thermal_zone_device * tz )
931
+ {
932
+ struct thermal_debugfs * thermal_dbg = tz -> debugfs ;
933
+ ktime_t now = ktime_get ();
934
+ struct tz_debugfs * tz_dbg ;
935
+ struct tz_episode * tze ;
936
+ int i ;
937
+
938
+ if (!thermal_dbg )
939
+ return ;
940
+
941
+ mutex_lock (& thermal_dbg -> lock );
942
+
943
+ tz_dbg = & thermal_dbg -> tz_dbg ;
944
+
945
+ if (!tz_dbg -> nr_trips )
946
+ goto out ;
947
+
948
+ /*
949
+ * A mitigation episode was in progress before the preceding system
950
+ * suspend transition, so close it because the zone handling is starting
951
+ * over from scratch.
952
+ */
953
+ tze = list_first_entry (& tz_dbg -> tz_episodes , struct tz_episode , node );
954
+
955
+ for (i = 0 ; i < tz_dbg -> nr_trips ; i ++ )
956
+ tz_episode_close_trip (tze , tz_dbg -> trips_crossed [i ], now );
957
+
958
+ tze -> duration = ktime_sub (now , tze -> timestamp );
959
+
960
+ tz_dbg -> nr_trips = 0 ;
961
+
962
+ out :
963
+ mutex_unlock (& thermal_dbg -> lock );
964
+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ void thermal_debug_cdev_remove(struct thermal_cooling_device *cdev);
7
7
void thermal_debug_cdev_state_update (const struct thermal_cooling_device * cdev , int state );
8
8
void thermal_debug_tz_add (struct thermal_zone_device * tz );
9
9
void thermal_debug_tz_remove (struct thermal_zone_device * tz );
10
+ void thermal_debug_tz_resume (struct thermal_zone_device * tz );
10
11
void thermal_debug_tz_trip_up (struct thermal_zone_device * tz ,
11
12
const struct thermal_trip * trip );
12
13
void thermal_debug_tz_trip_down (struct thermal_zone_device * tz ,
@@ -20,6 +21,7 @@ static inline void thermal_debug_cdev_state_update(const struct thermal_cooling_
20
21
int state ) {}
21
22
static inline void thermal_debug_tz_add (struct thermal_zone_device * tz ) {}
22
23
static inline void thermal_debug_tz_remove (struct thermal_zone_device * tz ) {}
24
+ static inline void thermal_debug_tz_resume (struct thermal_zone_device * tz ) {}
23
25
static inline void thermal_debug_tz_trip_up (struct thermal_zone_device * tz ,
24
26
const struct thermal_trip * trip ) {};
25
27
static inline void thermal_debug_tz_trip_down (struct thermal_zone_device * tz ,
You can’t perform that action at this time.
0 commit comments