[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231020105658.4zjfuiawwyrtnssu@vireshk-i7>
Date: Fri, 20 Oct 2023 16:26: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 20-10-23, 12:02, Ulf Hansson wrote:
> 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?
So the thing is that I _really_ want to call dev_pm_opp_set_opp() for
each OPP we want to configure, primary or required. For example, the
required OPP may want to do more than just performance state and we
aren't touching them right now.
Now, in order to call dev_pm_opp_set_opp() for any device, we need a
device pointer and an OPP table associated with it.
I can take care of it for the multi genpd case as there are extra
device structures (which we get from dev_pm_domain_attach_by_name()),
but there is no clean way out for single PM domain devices, unless
they also call dev_pm_opp_set_config() to get a virtual structure.
This is why I had to get this hackish code in place to make it work
with the recursive calls to dev_pm_opp_set_opp(), where I could just
reuse the opp-level thing for the primary device.
How do you suggest we take care of this now ?
--
viresh
Powered by blists - more mailing lists