[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFqMA9=qdz4L3Oqj0zRQmSj0bxrF1RzZu-pBcuj9__GSRw@mail.gmail.com>
Date: Fri, 20 Oct 2023 12:02:08 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Viresh Kumar <viresh.kumar@...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 Fri, 20 Oct 2023 at 05:45, Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 19-10-23, 13:16, Ulf Hansson wrote:
> > On Thu, 19 Oct 2023 at 12:22, Viresh Kumar <viresh.kumar@...aro.org> wrote:
> > > + /*
> > > + * 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?
>
> Such platforms need to call dev_pm_opp_set_config() with genpd names
> and it should all work just fine. The point is that we can't use the
> same `dev` pointer with another OPP table, i.e. device's dev pointer
> for the genpd's table here.
For the single PM domain case, consumer drivers are often not able to
use dev_pm_opp_set_config(). That's because the PM domain has already
been attached from some of the generic buses, through
dev_pm_domain_attach().
In this case, as dev_pm_opp_set_config() ends up trying to attach
again, via dev_pm_domain_attach_by_name() it would receive
"ERR_PTR(-EEXIST)".
Or maybe I didn't quite understand your point?
Kind regards
Uffe
Powered by blists - more mailing lists