From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Anson Huang <Anson.Huang@nxp.com>,
Eduardo Valentin <edubezval@gmail.com>,
Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL 4.4 1/7] thermal: of-thermal: disable passive polling when thermal zone is disabled
Date: Thu, 20 Sep 2018 02:49:36 +0000 [thread overview]
Message-ID: <20180920024932.58727-1-alexander.levin@microsoft.com> (raw)
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
next reply other threads:[~2018-09-20 2:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 2:49 Sasha Levin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180920024932.58727-1-alexander.levin@microsoft.com \
--to=alexander.levin@microsoft.com \
--cc=Anson.Huang@nxp.com \
--cc=edubezval@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).