mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Di Shen <cindygm567@gmail.com>, Di Shen <di.shen@unisoc.com>
Cc: rafael@kernel.org, daniel.lezcano@linaro.org,
	rui.zhang@intel.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, xuewen.yan@unisoc.com,
	zhanglyra@gmail.com, orsonzhai@gmail.com
Subject: Re: [PATCH V2] thermal: power_allocator: Avoid overwriting PID coefficients from setup time
Date: Tue, 6 Feb 2024 12:15:33 +0000	[thread overview]
Message-ID: <62f4258a-6739-4a3b-8fc3-09e04ea55dab@arm.com> (raw)
In-Reply-To: <CAHYJL4oBPJ=pL2GT+-j398-TsmRG9D3rwFZyo7KaHvewQk4n0w@mail.gmail.com>

Hi Di,

On 2/4/24 02:55, Di Shen wrote:
> Hi Lukasz,
> 
> On Thu, Jan 25, 2024 at 2:24 PM Di Shen <di.shen@unisoc.com> wrote:
>>
>> When the PID coefficients k_* are set via sysfs before the IPA
>> algorithm is triggered then the coefficients would be overwritten after
>> IPA throttle() is called. The old configuration values might be
>> different than the new values estimated by the IPA internal algorithm.
>>
>> There might be a time delay when this overwriting happens. It
>> depends on the thermal zone temperature value. The temperature value
>> needs to cross the first trip point value then IPA algorithms start
>> operating. Although, the PID coefficients setup time should not be
>> affected or linked to any later operating phase and values must not be
>> overwritten.
>>
>> This patch initializes params->sustainable_power when the governor
>> binds to thermal zone to avoid overwriting k_*. The basic function won't
>> be affected, as the k_* still can be estimated if the sustainable_power
>> is modified.
>>
>> Signed-off-by: Di Shen <di.shen@unisoc.com>
>> ---
>>   drivers/thermal/gov_power_allocator.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
>> index 81e061f183ad..1b17dc4c219c 100644
>> --- a/drivers/thermal/gov_power_allocator.c
>> +++ b/drivers/thermal/gov_power_allocator.c
>> @@ -711,6 +711,8 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
>>
>>          if (!tz->tzp->sustainable_power)
>>                  dev_warn(&tz->device, "power_allocator: sustainable_power will be estimated\n");
>> +       else
>> +               params->sustainable_power = tz->tzp->sustainable_power;
>>
>>          estimate_pid_constants(tz, tz->tzp->sustainable_power,
>>                                 params->trip_switch_on,
>> --
>> 2.17.1
>>
> 
> Any comments on patchv2?
> Looking forward to hearing from you. Thanks!

My apologies I was out-of-office.

That v2 patch looks good. Although, please resend it as a new
message, not as a response to the v1. In that way it's easier to
pick it up by maintainers. You can use a tag:
[RESEND][PATCH v2] .....

You can add
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz

      reply	other threads:[~2024-02-06 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 11:49 [PATCH] thermal: power_allocator: initialize params->sustainable_power in the bind callback Di Shen
2024-01-24 17:54 ` Lukasz Luba
2024-01-25  6:23   ` [PATCH V2] thermal: power_allocator: Avoid overwriting PID coefficients from setup time Di Shen
2024-02-04  2:55     ` Di Shen
2024-02-06 12:15       ` Lukasz Luba [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=62f4258a-6739-4a3b-8fc3-09e04ea55dab@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=cindygm567@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=di.shen@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=xuewen.yan@unisoc.com \
    --cc=zhanglyra@gmail.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

all inboxes | Powered by JetHome®