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

Commit 40f107b9 authored by Ram Chandrasekar's avatar Ram Chandrasekar Committed by Vikram Mulukutla
Browse files

drivers: thermal: step-wise: Optimize mitigation request evaluation



When evaluating a thermal instance which doesn't have any previous
mitigation request and if there is no new mitigation request step wise
algorithm will still evaluate the new request. This can cause the
algorithm to trigger a false mitigation, based on the temperature trend.

Avoid evaluating the mitigation request if there is no previous and new
mitigation request for a thermal instance.

Change-Id: I056aa0640bed5f296828bfceda44204d01e93064
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 7529b53b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@ static unsigned long get_target_state(struct thermal_instance *instance,
		return next_target;
	}

	/*
	 * If there is no new throttle request and if the thermal zone
	 * wasn't requesting any previous mitigation, then skip the
	 * evaluation.
	 */
	if (instance->target == THERMAL_NO_TARGET && !throttle)
		return next_target;

	switch (trend) {
	case THERMAL_TREND_RAISING:
		if (throttle) {