Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case

From: Ulf Hansson
Date: Fri Nov 10 2023 - 13:28:35 EST


On Mon, 6 Nov 2023 at 08:08, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> On 03-11-23, 12:58, Ulf Hansson wrote:
> > Are you saying that the OPP library should be capable of managing the
> > parent-clock-rates too, when there is a new rate being requested for a
> > clock that belongs to an OPP? To me, that sounds like replicating
> > framework specific knowledge into the OPP library, no? Why do we want
> > this?
>
> I am surely not touching clocks or any other framework :)
>
> > Unless I totally misunderstood your suggestion, I think it would be
> > better if the OPP library remained simple and didn't run recursive
> > calls, but instead relied on each framework to manage the aggregation
> > and propagation to parents.
>
> I see your point and agree with it.

Okay!

>
> Here is the problem and I am not very sure what's the way forward for this then:
>
> - Devices can have other devices (like caches) or genpds mentioned via
> required-opps.
>
> - Same is true for genpds, they can also have required-opps, which may or may not
> be other genpds.
>
> - When OPP core is asked to set a device's OPP, it isn't only about performance
> level, but clk, level, regulator, bw, etc. And so a full call to
> dev_pm_opp_set_opp() is required.
>
> - The OPP core is going to run the helper recursively only for required-opps and
> hence it won't affect clock or regulators.

What if a required-opps has a clock or regulator? Doesn't that mean
that clocks/regulators could be called too?

>
> - But it currently affects genpds as they are mentioned in required-opps.
>
> - Skipping the recursive call to a parent genpd will require a special hack,
> maybe we should add it, I am just discussing it if we should or if there is
> another way around this.

Right, I see.

If this is only for required-opps and devices being hooked up to a PM
domain (genpd), my suggestion would be to keep avoiding doing the
propagation to required-opps-parents. For the similar reasons to why
we don't do it for clock/regulators, the propagation and aggregation,
seems to me, to belong better in genpd.

Did that make sense?

Kind regards
Uffe