From: Lukasz Luba <lukasz.luba@arm.com>
To: Di Shen <di.shen@unisoc.com>
Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com, rafael@kernel.org,
daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org,
xuewen.yan@unisoc.com, jeson.gao@unisoc.com, orsonzhai@gmail.com,
zhanglyra@gmail.com, amitk@kernel.org
Subject: Re: [PATCH] Revert "thermal: power allocator: change the 'k_*' always in estimate_pid_constants()"
Date: Wed, 19 Jul 2023 09:39:53 +0100 [thread overview]
Message-ID: <47ded4da-5c39-9132-7978-d0f8c8ee0318@arm.com> (raw)
In-Reply-To: <20230712084840.3594-1-di.shen@unisoc.com>
Hi Di,
On 7/12/23 09:48, Di Shen wrote:
> This reverts commit 90a996544946d1d4834ec2ec8add586edd905779.
>
> The commit ensures that the pid constants are updated when
> sustainable_power changes, but it makes it impossible for
> the driver to set the pid constants when the sustainable_power
> is not changed.
>
> When the driver tries to register a thermal zone device by
> thermal_zone_device_register_with_trips(const char *type,
> struct thermal_trip *trips, int num_trips, int mask,
> void *devdata, struct thermal_zone_device_ops *ops,
> struct thermal_zone_params *tzp, int passive_delay,
> int polling_delay)
> and passes the private thermal_zone_params structure data,
>
> thermal_zone_devcice_register_with_trips
> |
> thermal_set_governor
> |
> bind_to_tz
> |
> power_allocator_bind
> |
> estimate_pid_constants
>
> the tzp->k_* will not be the data that driver have given,
> but the data estimated by sustainable_power.
>
> To make it possible for driver to add its own pid constants,
That was dropped, the drivers shouldn't configure 'k_*' IPA
parameters. There was also an ask to add those parameter
values to the DT for setup - also not allowed.
> the 'force' flag is needed to indicate whether the tzp->k_*
> should be estimated by sustainable_power or not.
We don't want to maintain many different ways of configurations,
which can cause bugs in not tested corner cases.
Please use the user-space to change those 'k_*' parameters.
There are this dedicated and safe sysfs interfaces for each
thermal zone.
The phones that I have on my desk do the update of 'k_*' parameters via
sysfs. They do this in different scenarios. You can try to derive
best 'k_*' values for your workload scenarios and than save
them in the config file. You can update in runtime from user-space
when you switch to your scenario (e.g. camera, game, video call).
Regards,
Lukasz
next prev parent reply other threads:[~2023-07-19 8:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 8:48 [PATCH] Revert "thermal: power allocator: change the 'k_*' always in estimate_pid_constants()" Di Shen
2023-07-19 8:39 ` Lukasz Luba [this message]
2023-07-19 10:09 ` Di Shen
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=47ded4da-5c39-9132-7978-d0f8c8ee0318@arm.com \
--to=lukasz.luba@arm.com \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=di.shen@unisoc.com \
--cc=jeson.gao@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