linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 1/7] thermal: of-thermal: disable passive polling when thermal zone is disabled
@ 2018-09-20  2:49 Sasha Levin
  2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 2/7] net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES Sasha Levin
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sasha Levin @ 2018-09-20  2:49 UTC (permalink / raw)
  To: stable@vger.kernel.org, linux-kernel@vger.kernel.org
  Cc: Anson Huang, Eduardo Valentin, Sasha Levin

From: Anson Huang <Anson.Huang@nxp.com>

[ Upstream commit 152395fd03d4ce1e535a75cdbf58105e50587611 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/thermal/of-thermal.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index be4eedcb839a..236c4eb5cf78 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -284,10 +284,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.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-20  2:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20  2:49 [PATCH AUTOSEL 4.4 1/7] thermal: of-thermal: disable passive polling when thermal zone is disabled Sasha Levin
2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 2/7] net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES Sasha Levin
2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 3/7] e1000: check on netif_running() before calling e1000_up() Sasha Levin
2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 4/7] e1000: ensure to free old tx/rx rings in set_ringparam() Sasha Levin
2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 5/7] hwmon: (ina2xx) fix sysfs shunt resistor read access Sasha Levin
2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 6/7] hwmon: (adt7475) Make adt7475_read_word() return errors Sasha Levin
2018-09-20  2:49 ` [PATCH AUTOSEL 4.4 7/7] i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).