Commit 3a3c0de6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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"
parents ab317b32 a26de34b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd

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

			/* Convert EM power into milli-Watts first */
			rcu_read_lock();
+2 −17
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
{
	const struct thermal_trip *trip;
	int low = -INT_MAX, high = INT_MAX;
	bool same_trip = false;
	int ret;

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

	for_each_trip(tz, trip) {
		bool low_set = false;
		int trip_low;

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

		if (trip_low < tz->temperature && trip_low > low) {
		if (trip_low < tz->temperature && trip_low > low)
			low = trip_low;
			low_set = true;
			same_trip = false;
		}

		if (trip->temperature > tz->temperature &&
		    trip->temperature < high) {
		    trip->temperature < high)
			high = trip->temperature;
			same_trip = low_set;
		}
	}

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

	/*
	 * If "high" and "low" are the same, skip the change unless this is the
	 * first time.
	 */
	if (same_trip && (tz->prev_low_trip != -INT_MAX ||
	    tz->prev_high_trip != INT_MAX))
		return;

	tz->prev_low_trip = low;
	tz->prev_high_trip = high;