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

Commit 1df9b489 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: step_wise: Optimize mitigation evaluation



There is a possibility that a zone will have a polling delay to evaluate
the temperature and determine the mitigation temperature. There is a
possibility that the cooling device to mitigate in this zone might be
mitigated by another zone. The non-mitigating polling type thermal zone,
will use the current mitigation for the cooling device and reduces the
mitigation by one level and this level is active till the other
mitigation clears. Once the other mitigation clears, the mitigation vote
by this non-mitigating thermal zone will reduce step by step. Thus the
mitigation is not cleared right away in this case, instead it takes
multiple polling iteration to clear. This could cause performance
impact.

To avoid this scenario in step-wise algorithm, skip the evaluation of
mitigation when the trip is not reached and there is no previous
mitigation vote. This optimization will prevent the unnecessary
mitigation vote from the non-mitigating thermal zone.

Change-Id: I3939cb53937b650ecf432989f065cfa619297397
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 773b595b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -53,6 +53,12 @@ static unsigned long get_target_state(struct thermal_instance *instance,
	unsigned long cur_state;
	unsigned long next_target;

	/*
	 * If the throttle condition is not reached and there is no
	 * previous mitigaiton request, then there is nothing to compute.
	 */
	if (!throttle && instance->target == THERMAL_NO_TARGET)
		return THERMAL_NO_TARGET;
	/*
	 * We keep this instance the way it is by default.
	 * Otherwise, we use the current state of the