diff mbox series

[4/6] thermal: core: stop polling timer for disabled thermal zone

Message ID 20200430063229.6182-5-rui.zhang@intel.com (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show
Series thermal: improve handling of disabled thermal zone | expand

Commit Message

Zhang Rui April 30, 2020, 6:32 a.m. UTC
For a disabled thermal zone, thermal_zone_device_update() should do
nothing but cancelling the polling timer.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/thermal_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bartlomiej Zolnierkiewicz May 4, 2020, 7:02 a.m. UTC | #1
On 4/30/20 8:32 AM, Zhang Rui wrote:
> For a disabled thermal zone, thermal_zone_device_update() should do
> nothing but cancelling the polling timer.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
>  drivers/thermal/thermal_core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 04a16a9..5f7a867 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -508,7 +508,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
>  	int count;
>  
>  	if (should_stop_polling(tz))
> -		return;
> +		goto update_polling;
>  
>  	if (atomic_read(&in_suspend))
>  		return;
> @@ -525,6 +525,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
>  	for (count = 0; count < tz->trips; count++)
>  		handle_thermal_trip(tz, count);
>  
> +update_polling:
>  	/*
>  	 * Alright, we handled all the trips successfully.
>  	 * So, start monitoring again.
>
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 04a16a9..5f7a867 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -508,7 +508,7 @@  void thermal_zone_device_update(struct thermal_zone_device *tz,
 	int count;
 
 	if (should_stop_polling(tz))
-		return;
+		goto update_polling;
 
 	if (atomic_read(&in_suspend))
 		return;
@@ -525,6 +525,7 @@  void thermal_zone_device_update(struct thermal_zone_device *tz,
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
 
+update_polling:
 	/*
 	 * Alright, we handled all the trips successfully.
 	 * So, start monitoring again.