Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19263c9b authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: step-wise: Update the mitigation clear logic



Step-wise algorithm will lower mitigation if the temperature is above the
trip and the trend is decreasing. This ends up in a case where the
temperature is bouncing up and down above the trip and the observed max
temperature is increasing steadily. This will eventually lead to
device reset for reaching the critical temperature.

To avoid this, update the step-wise algorithm to not reduce the
mitigation if the temperature is above the trip and the trend is
decreasing. The algorithm will apply the previous mitigation value in
the above case.

Change-Id: Ia734c19af5e732948a3f755c719ed9dedbf7ce3b
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent debcd41d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ static unsigned long get_target_state(struct thermal_instance *instance,
			if (!throttle)
				next_target = THERMAL_NO_TARGET;
		} else {
			if (!throttle)
				next_target = cur_state - 1;
			if (next_target > instance->upper)
				next_target = instance->upper;