[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220224094216.mtxjjx65bbjzalqx@vireshk-i7>
Date: Thu, 24 Feb 2022 15:12:16 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Lukasz Luba <lukasz.luba@....com>
Cc: linux-kernel@...r.kernel.org, dietmar.eggemann@....com,
rafael@...nel.org, daniel.lezcano@...aro.org, nm@...com,
sboyd@...nel.org, mka@...omium.org, dianders@...omium.org,
robh+dt@...nel.org, devicetree@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [PATCH v3 3/4] OPP: Add support of "opp-microwatt" for advanced
EM registration
On 24-02-22, 09:33, Lukasz Luba wrote:
> On 2/24/22 09:13, Viresh Kumar wrote:
> > On 24-02-22, 08:11, Lukasz Luba wrote:
> > > diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> > > +static bool _of_has_opp_microwatt_property(struct device *dev)
> > > +{
> > > + unsigned long power, freq = 0;
> > > + struct dev_pm_opp *opp;
> > > +
> > > + /* Check if at least one OPP has needed property */
> > > + opp = dev_pm_opp_find_freq_ceil(dev, &freq);
> > > + if (IS_ERR(opp))
> > > + return false;
> > > +
> > > + power = dev_pm_opp_get_power(opp);
> > > + dev_pm_opp_put(opp);
> > > + if (!power)
> >
> > Instead of this heavy stuff, just pick the first OPP from the opp
> > table and see its power-value.
>
> It is the first opp: freq=0.
> You mean by parsing the the DT node instead, like I had in v2 version?
No, I was thinking if you can simply do:
opp = list_first_entry(&opp_table->opp_list, struct dev_pm_opp, node);
But that requires locking, etc as well. So maybe this is fine.
--
viresh
Powered by blists - more mailing lists