Re: [PATCH 1/1] thermal: setup monitor only once after handling trips

From: Chen, Yu C
Date: Wed Nov 25 2015 - 02:16:25 EST


Hi,
On Tue, 2015-11-24 at 20:07 -0800, Eduardo Valentin wrote:
> Instead of changing the monitoring setup every time after
> handling each trip, this patch simplifies the monitoring
> setup by moving the setup call to a place where all
> trips have been treated already.
>
> Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
> Cc: linux-pm@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Eduardo Valentin <edubezval@xxxxxxxxx>
> ---
> drivers/thermal/thermal_core.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index d9e525c..6debb54 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
> handle_critical_trips(tz, trip, type);
> else
> handle_non_critical_trips(tz, trip, type);
> - /*
> - * Alright, we handled this trip successfully.
> - * So, start monitoring again.
> - */
> - monitor_thermal_zone(tz);
> }
>
> /**
> @@ -547,6 +542,12 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
>
> for (count = 0; count < tz->trips; count++)
> handle_thermal_trip(tz, count);
> +
> + /*
> + * Alright, we handled this trip successfully.
s/these trips ?
> + * So, start monitoring again.
> + */
> + monitor_thermal_zone(tz);
> }
> EXPORT_SYMBOL_GPL(thermal_zone_device_update);
>
BTW, thermal_notify_framework might need be affected?

thanks,
Yu
N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå