From: Zhang Rui <rui.zhang@intel.com>
To: Wei Wang <wvw@google.com>
Cc: wei.vince.wang@gmail.com, Eduardo Valentin <edubezval@gmail.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: core: skip update disabled thermal zones after suspend
Date: Mon, 22 Apr 2019 17:03:20 +0800 [thread overview]
Message-ID: <1555923800.26198.30.camel@intel.com> (raw)
In-Reply-To: <20190416170701.50333-1-wvw@google.com>
On 二, 2019-04-16 at 10:07 -0700, Wei Wang wrote:
> It is unnecessary to update disabled thermal zones post suspend and
> sometimes leads error/warning in bad behaved thermal drivers.
>
a good catch, and in fact, there are more issues about thermal handling
for disabled thermal zones, like we're able to read the temperature of
disabled thermal zones, either via sysfs or via function calls like
thermal_zone_device_update.
For this patch, I will take it as it fixes one of the problem.
thanks,
rui
> Signed-off-by: Wei Wang <wvw@google.com>
> ---
> drivers/thermal/thermal_core.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c
> index 6590bb5cb688..5baf5cfab999 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -1494,6 +1494,7 @@ static int thermal_pm_notify(struct
> notifier_block *nb,
> unsigned long mode, void *_unused)
> {
> struct thermal_zone_device *tz;
> + enum thermal_device_mode tz_mode;
>
> switch (mode) {
> case PM_HIBERNATION_PREPARE:
> @@ -1506,6 +1507,13 @@ static int thermal_pm_notify(struct
> notifier_block *nb,
> case PM_POST_SUSPEND:
> atomic_set(&in_suspend, 0);
> list_for_each_entry(tz, &thermal_tz_list, node) {
> + tz_mode = THERMAL_DEVICE_ENABLED;
> + if (tz->ops->get_mode)
> + tz->ops->get_mode(tz, &tz_mode);
> +
> + if (tz_mode == THERMAL_DEVICE_DISABLED)
> + continue;
> +
> thermal_zone_device_init(tz);
> thermal_zone_device_update(tz,
> THERMAL_EVENT_UNS
> PECIFIED);
next prev parent reply other threads:[~2019-04-22 9:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 17:07 [PATCH] thermal: core: skip update disabled thermal zones after suspend Wei Wang
2019-04-22 9:03 ` Zhang Rui [this message]
2019-04-22 16:44 ` Wei Wang
2019-04-23 6:15 ` Zhang Rui
2019-04-23 22:50 ` Wei Wang
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=1555923800.26198.30.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=edubezval@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=wei.vince.wang@gmail.com \
--cc=wvw@google.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