On Mon, 29 Jul 2024 at 08:05, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote: > > On 28-07-24, 22:05, Ulf Hansson wrote: > > > > > I think that design is rather correct, just like other frameworks. Just that we > > > > > need to do only set-level for genpds and nothing else. That will have exactly > > > > > the same behavior that you want. > > > > > > > > I don't quite understand what you are proposing. Do you want to add a > > > > separate path for opp-levels? > > > > > > Not separate paths, but ignore clk/regulator changes if the table belongs to a > > > genpd. > > > > > > > The problem with that would be that platforms (Tegra at least) are > > > > already using a combination of opp-level and clocks. > > > > > > If they are using both for a genpd's OPP table (and changes are made for both > > > opp-level and clock by the OPP core), then it should already be wrong, isn't it? > > > > They are changing the clock through the device's OPP table and the > > level (performance-state) via genpd's table (using required OPPs). > > This works fine as of today. > > There is a problem here I guess then. Lets say there are two devices A and B, > that depend on a genpd. > > A requests required OPP 5 (level 5, clk 1.4 GHz), followed by > B requests required OPP 3 (level 3, clk 1 GHz). > > After this level will be configured to 5 and clk to 1 GHz I think. The level would be 5, as the aggregated votes in genpd would be correct in this case. In regards to the clocks, I assume this is handled correctly too, as the clocks are per device clocks that don't belong to the genpd. > > > It's working today for *opp-level* only, because of the commit above. > > That's correct. > > Good. > > > My point is that calling dev_pm_opp_set_opp() recursively from > > _set_required_opps() doesn't make sense for the single PM domain case, > > as we can't assign a required-dev for it. This leads to an > > inconsistent behaviour when managing the required-OPPs. > > We won't be calling that because of the above patch. In case of a single dev, > the required device isn't set and so we will never end up calling > dev_pm_opp_set_opp() for a single genpd case. That's right, but why do we want to call dev_pm_opp_set_opp() for the multiple PM domain case then? It makes the behaviour inconsistent. Kind regards Uffe