From: Zhang Rui <rui.zhang@intel.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>,
rjw@rjwysocki.net, Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Guenter Roeck <groeck@chromium.org>, Sameer Nanda <snanda@chromium.org>
Subject: Re: [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver.
Date: Fri, 30 Jun 2017 10:40:34 +0800 [thread overview]
Message-ID: <1498790434.2520.5.camel@intel.com> (raw)
In-Reply-To: <20170629165035.23101-1-enric.balletbo@collabora.com>
On Thu, 2017-06-29 at 18:50 +0200, Enric Balletbo i Serra wrote:
> Use thermal_set_mode instead of just set the tz_enable variable when
> enabling the ACPI thermal driver. The purpose of this change is
> trigger
> a thermal_zone_device_update when driver switches from disabled to
> enabled mode so thermal_zone data is up-to-date.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> This patch is new from v1 [1]
>
> [1] https://patchwork.kernel.org/patch/9804229/
>
> drivers/acpi/thermal.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 1d0417b..9949458 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -930,7 +930,9 @@ static int
> acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
> if (ACPI_FAILURE(status))
> return -ENODEV;
>
> - tz->tz_enabled = 1;
> + result = thermal_set_mode(tz->thermal_zone,
> THERMAL_DEVICE_ENABLED);
> + if (result)
> + return result;
thermal core is responsible for checking the thermal zone "mode", and
set the polling properly, right after thermal_zone_device_being
registered.
Thus we need to do nothing, but just make sure tz->tz_enabled is set
properly before registering the zone.
thanks,
rui
>
> dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
> tz->thermal_zone->id);
prev parent reply other threads:[~2017-06-30 2:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 16:50 [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver Enric Balletbo i Serra
2017-06-29 16:50 ` [PATCH v2 2/2] thermal: core: Allow to disable polling when disabling thermal zone Enric Balletbo i Serra
2017-06-30 5:05 ` Zhang Rui
2017-06-30 8:15 ` Enric Balletbo Serra
2017-07-01 3:06 ` Zhang Rui
2017-06-30 2:40 ` Zhang Rui [this message]
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=1498790434.2520.5.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=enric.balletbo@collabora.com \
--cc=groeck@chromium.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=snanda@chromium.org \
/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).