[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150928142812.GA8359@e104805>
Date: Mon, 28 Sep 2015 15:28:13 +0100
From: Javi Merino <javi.merino@....com>
To: Chen Yu <yu.c.chen@...el.com>
Cc: "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"edubezval@...il.com" <edubezval@...il.com>,
"rui.zhang@...el.com" <rui.zhang@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH 1/3] Thermal: initialize thermal zone device correctly
On Sun, Sep 27, 2015 at 06:48:28AM +0100, Chen Yu wrote:
> From: Zhang Rui <rui.zhang@...el.com>
>
> After thermal zone device registered, as we have not read any
> temperature before, thus tz->temperature should not be 0,
> which actually means 0C, and thermal trend is not available.
> In this case, we need specially handling for the first
> thermal_zone_device_update().
>
> Both thermal core framework and step_wise governor is
> enhanced to handle this.
It may be worth pointing out that the step_wise governor is the only
one that uses trends, so it's the only thermal governor that needs to
be updated.
> CC: <stable@...r.kernel.org> #3.18+
> Tested-by: Manuel Krause <manuelkrause@...scape.net>
> Tested-by: szegad <szegadlo@...zta.onet.pl>
> Tested-by: prash <prash.n.rao@...il.com>
> Tested-by: amish <ammdispose-arch@...oo.com>
> Tested-by: Matthias <morpheusxyz123@...oo.de>
> Signed-off-by: Zhang Rui <rui.zhang@...el.com>
> Signed-off-by: Chen Yu <yu.c.chen@...el.com>
One minor nit below, other than that,
Reviewed-by: Javi Merino <javi.merino@....com>
> ---
> drivers/thermal/step_wise.c | 18 ++++++++++++++++--
> drivers/thermal/thermal_core.c | 19 +++++++++++++++++--
> drivers/thermal/thermal_core.h | 1 +
> include/linux/thermal.h | 3 +++
> 4 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
> index 2f9f708..405de04 100644
> --- a/drivers/thermal/step_wise.c
> +++ b/drivers/thermal/step_wise.c
> @@ -63,6 +63,19 @@ static unsigned long get_target_state(struct thermal_instance *instance,
> next_target = instance->target;
> dev_dbg(&cdev->device, "cur_state=%ld\n", cur_state);
>
> + if (!instance->initialized) {
> + if (throttle) {
> + next_target = (cur_state + 1) >= instance->upper ?
> + instance->upper :
> + ((cur_state + 1) < instance->lower ?
> + instance->lower : (cur_state + 1));
> + } else {
> + next_target = THERMAL_NO_TARGET;
> + }
> +
> + return next_target;
> + }
> +
> switch (trend) {
> case THERMAL_TREND_RAISING:
> if (throttle) {
> @@ -149,7 +162,8 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
> dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n",
> old_target, (int)instance->target);
>
> - if (old_target == instance->target)
> + if (instance->initialized &&
> + old_target == instance->target)
nit: it fits in one line,
if (instance->initialized && old_target == instance->target)
is 77 characters.
Cheers,
Javi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists