From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Zhang Rui <rui.zhang@intel.com>
Cc: Andrew Bresticker <abrestic@chromium.org>,
Eduardo Valentin <eduardo.valentin@ti.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: step_wise: set throttle target within thermal instance limits
Date: Wed, 10 Apr 2013 16:22:41 -0400 [thread overview]
Message-ID: <5165CA11.3090709@ti.com> (raw)
In-Reply-To: <1365577575.2183.70.camel@rzhang1-mobl4>
On 10-04-2013 03:06, Zhang Rui wrote:
> On Tue, 2013-04-09 at 14:59 -0700, 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. This is necessary because, in the THREAML_TREND_RAISING and
>> THERMAL_TREND_DROPPING cases, the current state may only be incremented
>> or decremented by one even if it is outside the bounds of the thermal
>> instance. This might occur, for example, if the CPU is heating up
>> and hits a thermal trip point for the first time when it's frequency
>> is much higher than the range specified by the thermal instance
>> corresponding to the trip point.
>>
>> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
>
> applied.
Rui,
Can you please add my:
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Thanks,
>
> thanks,
> rui
>> ---
>> drivers/thermal/step_wise.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
>> index 407cde3..ca4f79f 100644
>> --- a/drivers/thermal/step_wise.c
>> +++ b/drivers/thermal/step_wise.c
>> @@ -59,9 +59,12 @@ static unsigned long get_target_state(struct thermal_instance *instance,
>>
>> switch (trend) {
>> case THERMAL_TREND_RAISING:
>> - if (throttle)
>> + if (throttle) {
>> cur_state = cur_state < instance->upper ?
>> (cur_state + 1) : instance->upper;
>> + if (cur_state < instance->lower)
>> + cur_state = instance->lower;
>> + }
>> break;
>> case THERMAL_TREND_RAISE_FULL:
>> if (throttle)
>> @@ -71,8 +74,11 @@ static unsigned long get_target_state(struct thermal_instance *instance,
>> if (cur_state == instance->lower) {
>> if (!throttle)
>> cur_state = -1;
>> - } else
>> + } else {
>> cur_state -= 1;
>> + if (cur_state > instance->upper)
>> + cur_state = instance->upper;
>> + }
>> break;
>> case THERMAL_TREND_DROP_FULL:
>> if (cur_state == instance->lower) {
>
>
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Zhang Rui <rui.zhang@intel.com>
Cc: Andrew Bresticker <abrestic@chromium.org>,
Eduardo Valentin <eduardo.valentin@ti.com>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] thermal: step_wise: set throttle target within thermal instance limits
Date: Wed, 10 Apr 2013 16:22:41 -0400 [thread overview]
Message-ID: <5165CA11.3090709@ti.com> (raw)
In-Reply-To: <1365577575.2183.70.camel@rzhang1-mobl4>
On 10-04-2013 03:06, Zhang Rui wrote:
> On Tue, 2013-04-09 at 14:59 -0700, 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. This is necessary because, in the THREAML_TREND_RAISING and
>> THERMAL_TREND_DROPPING cases, the current state may only be incremented
>> or decremented by one even if it is outside the bounds of the thermal
>> instance. This might occur, for example, if the CPU is heating up
>> and hits a thermal trip point for the first time when it's frequency
>> is much higher than the range specified by the thermal instance
>> corresponding to the trip point.
>>
>> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
>
> applied.
Rui,
Can you please add my:
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Thanks,
>
> thanks,
> rui
>> ---
>> drivers/thermal/step_wise.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
>> index 407cde3..ca4f79f 100644
>> --- a/drivers/thermal/step_wise.c
>> +++ b/drivers/thermal/step_wise.c
>> @@ -59,9 +59,12 @@ static unsigned long get_target_state(struct thermal_instance *instance,
>>
>> switch (trend) {
>> case THERMAL_TREND_RAISING:
>> - if (throttle)
>> + if (throttle) {
>> cur_state = cur_state < instance->upper ?
>> (cur_state + 1) : instance->upper;
>> + if (cur_state < instance->lower)
>> + cur_state = instance->lower;
>> + }
>> break;
>> case THERMAL_TREND_RAISE_FULL:
>> if (throttle)
>> @@ -71,8 +74,11 @@ static unsigned long get_target_state(struct thermal_instance *instance,
>> if (cur_state == instance->lower) {
>> if (!throttle)
>> cur_state = -1;
>> - } else
>> + } else {
>> cur_state -= 1;
>> + if (cur_state > instance->upper)
>> + cur_state = instance->upper;
>> + }
>> break;
>> case THERMAL_TREND_DROP_FULL:
>> if (cur_state == instance->lower) {
>
>
>
>
next prev parent reply other threads:[~2013-04-10 20:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 21:59 [PATCH] thermal: step_wise: set throttle target within thermal instance limits Andrew Bresticker
2013-04-10 7:06 ` Zhang Rui
2013-04-10 20:22 ` Eduardo Valentin [this message]
2013-04-10 20:22 ` Eduardo Valentin
2013-04-11 23:25 ` Zhang Rui
-- strict thread matches above, loose matches on Subject: below --
2013-04-08 23:56 Andrew Bresticker
2013-04-09 15:00 ` Eduardo Valentin
2013-04-09 15:00 ` Eduardo Valentin
2013-04-09 17:09 ` Andrew Bresticker
2013-04-09 17:17 ` Eduardo Valentin
2013-04-09 17:17 ` Eduardo Valentin
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=5165CA11.3090709@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.