Skip to contentSkip to conversation

thermal: of-thermal: disable passive polling when thermal zone is disabled

PATCH In review Anson Huang 1 participant 2 messages Jul 30, 2018 – Aug 24, 2018 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/thermal/of-thermal.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/thermal/of-thermal.c +5 -2
index 977a830..4f28165 100644
@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,
 
 	mutex_lock(&tz->lock);
 
-	if (mode == THERMAL_DEVICE_ENABLED)
+	if (mode == THERMAL_DEVICE_ENABLED) {
 		tz->polling_delay = data->polling_delay;
-	else
+		tz->passive_delay = data->passive_delay;
+	} else {
 		tz->polling_delay = 0;
+		tz->passive_delay = 0;
+	}
 
 	mutex_unlock(&tz->lock);
 
Signature · 1 line
2.7.4
#1 lore raw

Gentle Ping...

Anson Huang
Best Regards!

Quoted 44 lines

-----Original Message-----
From: Anson Huang
Sent: Tuesday, July 31, 2018 12:57 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: dl-linux-imx <[email protected]>; Nitin Garg <[email protected]>
Subject: [PATCH] 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.

---
 drivers/thermal/of-thermal.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/thermal/of-thermal.c index renamed from drivers/thermal/of-thermal.c +0 -0

977a830..4f28165 100644

drivers/thermal/of-thermal.c +5 -3
@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct
 thermal_zone_device *tz,
 
 	mutex_lock(&tz->lock);
 
-	if (mode == THERMAL_DEVICE_ENABLED)
+	if (mode == THERMAL_DEVICE_ENABLED) {
 		tz->polling_delay = data->polling_delay;
-	else
+		tz->passive_delay = data->passive_delay;
+	} else {
 		tz->polling_delay = 0;
+		tz->passive_delay = 0;
+	}
 
 	mutex_unlock(&tz->lock);
 
--

2.7.4