From: Ulf Hansson <ulf.hansson@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Stephan Gerhold <stephan.gerhold@kernkonzept.com>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case
Date: Wed, 25 Oct 2023 12:40:26 +0200 [thread overview]
Message-ID: <CAPDyKFr4vdsKVYEx0aF5k_a1bTjp3NzMpNgaXDJOJrvujT7iRg@mail.gmail.com> (raw)
In-Reply-To: <20231025065458.z3klmhahrcqh6qyw@vireshk-i7>
On Wed, 25 Oct 2023 at 08:55, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 19-10-23, 13:16, Ulf Hansson wrote:
> > On Thu, 19 Oct 2023 at 12:22, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > > +static int _link_required_opps(struct dev_pm_opp *opp, struct opp_table *opp_table,
> > > struct opp_table *required_table, int index)
> > > {
> > > struct device_node *np;
> > > @@ -314,6 +314,25 @@ static int _link_required_opps(struct dev_pm_opp *opp,
> > > return -ENODEV;
> > > }
> > >
> > > + /*
> > > + * There are two genpd (as required-opp) cases that we need to handle,
> > > + * devices with a single genpd and ones with multiple genpds.
> > > + *
> > > + * The single genpd case requires special handling as we need to use the
> > > + * same `dev` structure (instead of a virtual one provided by genpd
> > > + * core) for setting the performance state. Lets treat this as a case
> > > + * where the OPP's level is directly available without required genpd
> > > + * link in the DT.
> > > + *
> > > + * Just update the `level` with the right value, which
> > > + * dev_pm_opp_set_opp() will take care of in the normal path itself.
> > > + */
> > > + if (required_table->is_genpd && opp_table->required_opp_count == 1 &&
> > > + !opp_table->genpd_virt_devs) {
> > > + if (!WARN_ON(opp->level))
> >
> > Hmm. Doesn't this introduce an unnecessary limitation?
> >
> > An opp node that has a required-opps phande, may have "opp-hz",
> > "opp-microvolt", etc. Why would we not allow the "opp-level" to be
> > used too?
>
> Coming back to this, why would we ever want a device to have "opp-level" and
> "required-opp" (set to genpd's table) ? That would mean we will call:
>
> dev_pm_domain_set_performance_state() twice to set different level values.
Yes - and that would be weird, especially since the PM domain (genpd)
is already managing the aggregation and propagation to parent domains.
I guess I got a bit confused by the commit message for patch2/2, where
it sounded like you were striving towards introducing recursive calls
to set OPPs. Having a closer look, I realize that isn't the case,
which I think makes sense.
>
> And so it should be safe to force that if required-opp table is set to a genpd,
> then opp-level shouldn't be set. Maybe we should fail in that case, which isn't
> happening currently.
Yes, it seems better to fail earlier during the OF parsing of the
required-opps or when adding an OPP dynamically. In that way, the
WARN_ON above could be removed.
That said, sorry for the noise and either way, feel free to add (for
$subject patch):
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
next prev parent reply other threads:[~2023-10-25 10:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 10:21 [RFT PATCH 0/2] OPP: Simplify required-opp handling Viresh Kumar
2023-10-19 10:22 ` [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case Viresh Kumar
2023-10-19 11:16 ` Ulf Hansson
2023-10-20 3:45 ` Viresh Kumar
2023-10-20 10:02 ` Ulf Hansson
2023-10-20 10:56 ` Viresh Kumar
2023-10-20 11:09 ` Ulf Hansson
2023-10-25 6:54 ` Viresh Kumar
2023-10-25 10:40 ` Ulf Hansson [this message]
2023-10-25 10:48 ` Viresh Kumar
2023-10-25 13:47 ` Stephan Gerhold
2023-10-25 15:24 ` Viresh Kumar
2023-10-25 16:16 ` Stephan Gerhold
2023-10-26 9:53 ` Ulf Hansson
2023-10-30 10:29 ` Viresh Kumar
2023-11-03 11:58 ` Ulf Hansson
2023-11-06 7:08 ` Viresh Kumar
2023-11-10 13:50 ` Ulf Hansson
2023-11-15 5:32 ` Viresh Kumar
2023-11-16 10:44 ` Viresh Kumar
2023-10-19 10:22 ` [PATCH 2/2] OPP: Call dev_pm_opp_set_opp() for required OPPs Viresh Kumar
2023-10-24 11:18 ` Stephan Gerhold
2023-10-25 7:36 ` Viresh Kumar
2023-10-25 12:17 ` Stephan Gerhold
2023-10-25 15:20 ` Viresh Kumar
2023-10-25 16:03 ` Ulf Hansson
2023-10-26 7:44 ` Viresh Kumar
2023-10-25 13:51 ` Ulf Hansson
2023-10-25 15:09 ` 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=CAPDyKFr4vdsKVYEx0aF5k_a1bTjp3NzMpNgaXDJOJrvujT7iRg@mail.gmail.com \
--to=ulf.hansson@linaro.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=nm@ti.com \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.org \
--cc=stephan.gerhold@kernkonzept.com \
--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;
as well as URLs for NNTP newsgroup(s).