drivers: thermal: step_wise: Handle the temperature stable trend

Step wise algorithm ignores the temperature stable trend, which can
cause a case where step wise will not clear the mitigation, when the
temperature is lower than hysteresis and stays stable throughout.

In order to avoid this, consider temperature stable trend similar to
temperature dropping trend. This will lower the mitigation when the
temperature is less than hysteresis.

Change-Id: Ic7d1d35c74d732562193195e46af945ef41912c2
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This commit is contained in:
Ram Chandrasekar
2019-05-21 14:07:31 -06:00
parent a30f6ceaa2
commit 4cb3f76d12

View File

@ -89,6 +89,7 @@ static unsigned long get_target_state(struct thermal_instance *instance,
next_target = instance->upper;
break;
case THERMAL_TREND_DROPPING:
case THERMAL_TREND_STABLE:
if (cur_state <= instance->lower) {
if (!throttle)
next_target = THERMAL_NO_TARGET;