[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231025065458.z3klmhahrcqh6qyw@vireshk-i7>
Date: Wed, 25 Oct 2023 12:24:58 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Stephan Gerhold <stephan.gerhold@...nkonzept.com>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case
On 19-10-23, 13:16, Ulf Hansson wrote:
> On Thu, 19 Oct 2023 at 12:22, Viresh Kumar <viresh.kumar@...aro.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.
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.
--
viresh
Powered by blists - more mailing lists