Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 3a3c0de

Browse files
committed
Merge tag 'thermal-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fixes from Rafael Wysocki: "These revert a problematic optimization commit and address a devfreq cooling device issue. Specifics: - Revert thermal core optimization that introduced a functional issue causing a critical trip point to be crossed in some cases (Daniel Lezcano) - Add missing conversion between different state ranges to the devfreq cooling device driver (Ye Zhang)" * tag 'thermal-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: devfreq_cooling: Fix perf state when calculate dfc res_util Revert "thermal: core: Don't update trip points inside the hysteresis range"
2 parents ab317b3 + a26de34 commit 3a3c0de

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

drivers/thermal/devfreq_cooling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd
214214

215215
res = dfc->power_ops->get_real_power(df, power, freq, voltage);
216216
if (!res) {
217-
state = dfc->capped_state;
217+
state = dfc->max_state - dfc->capped_state;
218218

219219
/* Convert EM power into milli-Watts first */
220220
rcu_read_lock();

drivers/thermal/thermal_trip.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
6565
{
6666
const struct thermal_trip *trip;
6767
int low = -INT_MAX, high = INT_MAX;
68-
bool same_trip = false;
6968
int ret;
7069

7170
lockdep_assert_held(&tz->lock);
@@ -74,36 +73,22 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
7473
return;
7574

7675
for_each_trip(tz, trip) {
77-
bool low_set = false;
7876
int trip_low;
7977

8078
trip_low = trip->temperature - trip->hysteresis;
8179

82-
if (trip_low < tz->temperature && trip_low > low) {
80+
if (trip_low < tz->temperature && trip_low > low)
8381
low = trip_low;
84-
low_set = true;
85-
same_trip = false;
86-
}
8782

8883
if (trip->temperature > tz->temperature &&
89-
trip->temperature < high) {
84+
trip->temperature < high)
9085
high = trip->temperature;
91-
same_trip = low_set;
92-
}
9386
}
9487

9588
/* No need to change trip points */
9689
if (tz->prev_low_trip == low && tz->prev_high_trip == high)
9790
return;
9891

99-
/*
100-
* If "high" and "low" are the same, skip the change unless this is the
101-
* first time.
102-
*/
103-
if (same_trip && (tz->prev_low_trip != -INT_MAX ||
104-
tz->prev_high_trip != INT_MAX))
105-
return;
106-
10792
tz->prev_low_trip = low;
10893
tz->prev_high_trip = high;
10994

0 commit comments

Comments
 (0)