From 4cb3f76d12ff60f79f2a032bb2adae37352c4e0e Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Tue, 21 May 2019 14:07:31 -0600 Subject: [PATCH] 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 --- drivers/thermal/step_wise.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c index 0cc78d4b57cc..b07f2a7e3483 100644 --- a/drivers/thermal/step_wise.c +++ b/drivers/thermal/step_wise.c @@ -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;