linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Andrew Bresticker <abrestic@chromium.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	eduardo.valentin@ti.com
Subject: Re: [PATCH] thermal: step_wise: set throttle target within thermal instance limits
Date: Tue, 9 Apr 2013 11:00:49 -0400	[thread overview]
Message-ID: <51642D21.2060705@ti.com> (raw)
In-Reply-To: <1365465371-24652-1-git-send-email-abrestic@chromium.org>

Hi Andrew,

On 08-04-2013 19:56, Andrew Bresticker wrote:
> When selecting a target cooling state in get_target_state(), make sure
> that the state is at least as high as the minimum when the temperature
> is rising and at least as low as the maximum when the temperature is
> falling.  Previously the cooling level would only be incremented or
> decremented by one in these cases.
>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>   drivers/thermal/step_wise.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
> index 0cd5e9f..49992a4 100644
> --- a/drivers/thermal/step_wise.c
> +++ b/drivers/thermal/step_wise.c
> @@ -47,9 +47,13 @@ static unsigned long get_target_state(struct thermal_instance *instance,
>   	if (trend == THERMAL_TREND_RAISING) {
>   		cur_state = cur_state < instance->upper ?
>   			    (cur_state + 1) : instance->upper;
> +		if (cur_state < instance->lower)
> +			cur_state = instance->lower;
>   	} else if (trend == THERMAL_TREND_DROPPING) {
>   		cur_state = cur_state > instance->lower ?
>   			    (cur_state - 1) : instance->lower;
> +		if (cur_state > instance->upper)
> +			cur_state = instance->upper;
>   	}


In which situations cur_state will be out of the [lower;upper] 
boundaries? I mean at this point while temperature is rising, and we are 
rising the cooling level, we should be already above lower (and 
vice-versa). Can you please describe better the situation you are trying 
to cover/ that you have identified?

>
>   	return cur_state;
>


  reply	other threads:[~2013-04-09 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 23:56 [PATCH] thermal: step_wise: set throttle target within thermal instance limits Andrew Bresticker
2013-04-09 15:00 ` Eduardo Valentin [this message]
2013-04-09 17:09   ` Andrew Bresticker
2013-04-09 17:17     ` Eduardo Valentin
  -- strict thread matches above, loose matches on Subject: below --
2013-04-09 21:59 Andrew Bresticker
2013-04-10  7:06 ` Zhang Rui
2013-04-10 20:22   ` Eduardo Valentin
2013-04-11 23:25     ` 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=51642D21.2060705@ti.com \
    --to=eduardo.valentin@ti.com \
    --cc=abrestic@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --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).