linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: of-thermal: disable passive polling when thermal zone is disabled
@ 2018-07-30 16:56 Anson Huang
  2018-08-24  7:10 ` Anson Huang
  0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2018-07-30 16:56 UTC (permalink / raw)
  To: rui.zhang, edubezval, linux-pm, linux-kernel; +Cc: Linux-imx, nitin.garg

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>
---
 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 977a830..4f28165 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -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


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

* RE: [PATCH] thermal: of-thermal: disable passive polling when thermal zone is disabled
  2018-07-30 16:56 [PATCH] thermal: of-thermal: disable passive polling when thermal zone is disabled Anson Huang
@ 2018-08-24  7:10 ` Anson Huang
  0 siblings, 0 replies; 2+ messages in thread
From: Anson Huang @ 2018-08-24  7:10 UTC (permalink / raw)
  To: rui.zhang, edubezval, linux-pm, linux-kernel; +Cc: dl-linux-imx, Nitin Garg

Gentle Ping...

Anson Huang
Best Regards!


> -----Original Message-----
> From: Anson Huang
> Sent: Tuesday, July 31, 2018 12:57 AM
> To: rui.zhang@intel.com; edubezval@gmail.com; linux-pm@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>; Nitin Garg <nitin.garg@nxp.com>
> 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.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.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
> 977a830..4f28165 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -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


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

end of thread, other threads:[~2018-08-24  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 16:56 [PATCH] thermal: of-thermal: disable passive polling when thermal zone is disabled Anson Huang
2018-08-24  7:10 ` Anson Huang

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).