From: Jon Hunter <jonathanh@nvidia.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH 3/8] OPP: Reuse _opp_compare_key() in _opp_add_static_v2()
Date: Wed, 22 Jun 2022 14:58:25 +0100 [thread overview]
Message-ID: <eb9558fd-4f2d-4e83-f9a3-86ff5dd51784@nvidia.com> (raw)
In-Reply-To: <2e335a6c263704a8d465bd02896fc5fff0533fdc.1654849214.git.viresh.kumar@linaro.org>
On 10/06/2022 09:20, Viresh Kumar wrote:
> Reuse _opp_compare_key() in _opp_add_static_v2() instead of just
> comparing frequency while finding suspend frequency. Also add a comment
> over _opp_compare_key() explaining its return values.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/opp/core.c | 6 ++++++
> drivers/opp/of.c | 4 ++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index fe447f41c99e..9f284dc0d9d7 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -1618,6 +1618,12 @@ static bool _opp_supported_by_regulators(struct dev_pm_opp *opp,
> return true;
> }
>
> +/*
> + * Returns
> + * 0: opp1 == opp2
> + * 1: opp1 > opp2
> + * -1: opp1 < opp2
> + */
> int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2)
> {
> if (opp1->rate != opp2->rate)
> diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> index bec9644a7260..843923ab9d66 100644
> --- a/drivers/opp/of.c
> +++ b/drivers/opp/of.c
> @@ -929,8 +929,8 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
> /* OPP to select on device suspend */
> if (of_property_read_bool(np, "opp-suspend")) {
> if (opp_table->suspend_opp) {
> - /* Pick the OPP with higher rate as suspend OPP */
> - if (new_opp->rate > opp_table->suspend_opp->rate) {
> + /* Pick the OPP with higher rate/bw/level as suspend OPP */
> + if (_opp_compare_key(opp_table, new_opp, opp_table->suspend_opp) == 1) {
> opp_table->suspend_opp->suspend = false;
> new_opp->suspend = true;
> opp_table->suspend_opp = new_opp;
FYI ... if I checkout commit 00d776d33da9 ("OPP: Reuse
_opp_compare_key() in _opp_add_static_v2()") from next-20220622
it does not compile ...
drivers/opp/of.c: In function ‘_opp_add_static_v2’:
drivers/opp/of.c:933:25: error: passing argument 1 of ‘_opp_compare_key’ from incompatible pointer type [-Werror=incompatible-pointer-types]
if (_opp_compare_key(opp_table, new_opp, opp_table->suspend_opp) == 1) {
^~~~~~~~~
In file included from drivers/opp/of.c:22:0:
drivers/opp/opp.h:228:5: note: expected ‘struct dev_pm_opp *’ but argument is of type ‘struct opp_table *’
int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2);
^~~~~~~~~~~~~~~~
drivers/opp/of.c:933:8: error: too many arguments to function ‘_opp_compare_key’
if (_opp_compare_key(opp_table, new_opp, opp_table->suspend_opp) == 1) {
^~~~~~~~~~~~~~~~
In file included from drivers/opp/of.c:22:0:
drivers/opp/opp.h:228:5: note: declared here
int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2);
^~~~~~~~~~~~~~~~
This breaks bisecting -next and so would be good to fix this.
Cheers
Jon
--
nvpublic
next prev parent reply other threads:[~2022-06-22 13:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1654849214.git.viresh.kumar@linaro.org>
[not found] ` <8b29fa207024dc295639f9ba52c28e45782e3baa.1654849214.git.viresh.kumar@linaro.org>
2022-06-22 13:47 ` [PATCH 5/8] OPP: Allow multiple clocks for a device Jon Hunter
2022-06-22 14:15 ` Viresh Kumar
2022-06-22 15:27 ` Jon Hunter
2022-06-29 18:33 ` Dmitry Osipenko
2022-06-30 0:50 ` Viresh Kumar
2022-06-30 9:13 ` Dmitry Osipenko
2022-06-30 9:52 ` Viresh Kumar
2022-06-30 9:57 ` Dmitry Osipenko
2022-06-30 10:15 ` Viresh Kumar
2022-07-04 12:09 ` Viresh Kumar
2022-07-04 13:17 ` Dmitry Osipenko
2022-07-04 15:52 ` Viresh Kumar
2022-07-04 18:04 ` Dmitry Osipenko
2022-07-05 4:08 ` Viresh Kumar
[not found] ` <2e335a6c263704a8d465bd02896fc5fff0533fdc.1654849214.git.viresh.kumar@linaro.org>
2022-06-22 13:58 ` Jon Hunter [this message]
2022-06-22 14:07 ` [PATCH 3/8] OPP: Reuse _opp_compare_key() in _opp_add_static_v2() Viresh Kumar
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=eb9558fd-4f2d-4e83-f9a3-86ff5dd51784@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nm@ti.com \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vireshk@kernel.org \
/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