linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org, linux-wireless@vger.kernel.org,
	daniel.lezcano@linaro.org, andrzej.p@collabora.com,
	luca@coelho.fi
Subject: Re: [PATCH 5/6] thermal: core: introduce tz_disabled() helper function
Date: Mon, 4 May 2020 09:09:23 +0200	[thread overview]
Message-ID: <4aa6fd7d-9e0c-614a-88e9-0e2637a114d4@samsung.com> (raw)
In-Reply-To: <20200430063229.6182-6-rui.zhang@intel.com>


On 4/30/20 8:32 AM, Zhang Rui wrote:
> Rename should_stop_polling() to tz_disabled(), and make it global.
> Because there are platform thermal drivers which also need this.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/thermal/thermal_core.c | 17 ++++++++---------
>  include/linux/thermal.h        |  2 ++
>  2 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 5f7a867..1cd5d5d0 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -305,16 +305,9 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
>  		cancel_delayed_work(&tz->poll_queue);
>  }
>  
> -static inline bool should_stop_polling(struct thermal_zone_device *tz)
> -{
> -	return thermal_zone_device_get_mode(tz) == THERMAL_DEVICE_DISABLED;
> -}
> -
>  static void monitor_thermal_zone(struct thermal_zone_device *tz)
>  {
> -	bool stop;
> -
> -	stop = should_stop_polling(tz);
> +	bool stop = tz_disabled(tz);
>  
>  	mutex_lock(&tz->lock);
>  
> @@ -502,12 +495,18 @@ int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
>  }
>  EXPORT_SYMBOL_GPL(thermal_zone_device_set_mode);
>  
> +bool tz_disabled(struct thermal_zone_device *tz)
> +{
> +	return thermal_zone_device_get_mode(tz) == THERMAL_DEVICE_DISABLED;
> +}
> +EXPORT_SYMBOL(tz_disabled);

Is there actual reason to not make it _GPL?

[ all other thermal core functionality seems to be _GPL anyway ]

Otherwise the patch looks fine:

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

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

> +
>  void thermal_zone_device_update(struct thermal_zone_device *tz,
>  				enum thermal_notify_event event)
>  {
>  	int count;
>  
> -	if (should_stop_polling(tz))
> +	if (tz_disabled(tz))
>  		goto update_polling;
>  
>  	if (atomic_read(&in_suspend))
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index a87fbaf..0bc62ee 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -479,4 +479,6 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
>  	return thermal_zone_device_set_mode(tz, THERMAL_DEVICE_DISABLED);
>  }
>  
> +bool tz_disabled(struct thermal_zone_device *tz);
> +
>  #endif /* __THERMAL_H__ */
> 


  reply	other threads:[~2020-05-04  7:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30  6:32 [PATCH 0/6] thermal: improve handling of disabled thermal zone Zhang Rui
2020-04-30  6:32 ` [PATCH 1/6] iwlwifi: use thermal_zone_device_update() for temperature change Zhang Rui
2020-05-12  1:58   ` Zhang Rui
2020-05-18 11:21     ` Luca Coelho
2020-05-25  6:04       ` Zhang Rui
2020-05-25 13:33   ` Rafael J. Wysocki
2020-04-30  6:32 ` [PATCH 2/6] thermal: core: delete thermal_notify_framework() Zhang Rui
2020-04-30  8:47   ` Andrzej Pietrasiewicz
2020-04-30  8:58     ` Zhang, Rui
2020-04-30 11:32       ` Andrzej Pietrasiewicz
2020-04-30 11:33         ` Andrzej Pietrasiewicz
2020-05-04 10:18   ` Andrzej Pietrasiewicz
2020-04-30  6:32 ` [PATCH 3/6] thermal: core: update polling after all trips handled Zhang Rui
2020-05-04  7:01   ` Bartlomiej Zolnierkiewicz
2020-04-30  6:32 ` [PATCH 4/6] thermal: core: stop polling timer for disabled thermal zone Zhang Rui
2020-05-04  7:02   ` Bartlomiej Zolnierkiewicz
2020-04-30  6:32 ` [PATCH 5/6] thermal: core: introduce tz_disabled() helper function Zhang Rui
2020-05-04  7:09   ` Bartlomiej Zolnierkiewicz [this message]
2020-05-12  1:59     ` Zhang Rui
2020-04-30  6:32 ` [PATCH RFC 6/6] iwlwifi: enable thermal zone only when firmware loaded Zhang Rui

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=4aa6fd7d-9e0c-614a-88e9-0e2637a114d4@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=andrzej.p@collabora.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luca@coelho.fi \
    --cc=rui.zhang@intel.com \
    /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).