summaryrefslogtreecommitdiff
path: root/drivers/thermal/gov_step_wise.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/gov_step_wise.c')
-rw-r--r--drivers/thermal/gov_step_wise.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
index e0fdc497bfcc..65974fe8be0d 100644
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -93,6 +93,23 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
if (instance->initialized && old_target == instance->target)
continue;
+ if (trip->type == THERMAL_TRIP_PASSIVE) {
+ /*
+ * If the target state for this thermal instance
+ * changes from THERMAL_NO_TARGET to something else,
+ * ensure that the zone temperature will be updated
+ * (assuming enabled passive cooling) until it becomes
+ * THERMAL_NO_TARGET again, or the cooling device may
+ * not be reset to its initial state.
+ */
+ if (old_target == THERMAL_NO_TARGET &&
+ instance->target != THERMAL_NO_TARGET)
+ tz->passive++;
+ else if (old_target != THERMAL_NO_TARGET &&
+ instance->target == THERMAL_NO_TARGET)
+ tz->passive--;
+ }
+
instance->initialized = true;
mutex_lock(&instance->cdev->lock);