Skip to content

Commit 152395f

Browse files
Anson-HuangEduardo Valentin
authored andcommitted
thermal: of-thermal: disable passive polling when thermal zone is disabled
When thermal zone is in passive mode, disabling its mode from sysfs is NOT taking effect at all, it is still polling the temperature of the disabled thermal zone and handling all thermal trips, it makes user confused. The disabling operation should disable the thermal zone behavior completely, for both active and passive mode, this patch clears the passive_delay when thermal zone is disabled and restores it when it is enabled. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
1 parent d316522 commit 152395f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/thermal/of-thermal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,
260260

261261
mutex_lock(&tz->lock);
262262

263-
if (mode == THERMAL_DEVICE_ENABLED)
263+
if (mode == THERMAL_DEVICE_ENABLED) {
264264
tz->polling_delay = data->polling_delay;
265-
else
265+
tz->passive_delay = data->passive_delay;
266+
} else {
266267
tz->polling_delay = 0;
268+
tz->passive_delay = 0;
269+
}
267270

268271
mutex_unlock(&tz->lock);
269272

0 commit comments

Comments
 (0)