Re: [PATCH] opp: Provide a function for just setting bandwidth

From: Konrad Dybcio
Date: Fri May 26 2023 - 06:59:28 EST




On 26.05.2023 12:53, Viresh Kumar wrote:
> On 26-05-23, 11:17, Konrad Dybcio wrote:
>> Currently it's not possible to set just the bandwidth if the OPP
>> describes other properties (required-opps, opp-hz etc.).
>>
>> Introduce dev_pm_opp_set_bw() to solve this problem.
>
> The OPP core (intentionally) doesn't provide any such interface for
> freq, volt, bw, level, etc.
>
> Setting just one of the properties for a device is potentially harmful and the
> OPP must be set as a whole and so this isn't allowed. There is
> dev_pm_opp_set_freq(), but it uses freq to just find the OPP and sets entire OPP
> only.
>
> Why should be break this for bw ?
>
There are some users which have tight power sequencing requirements,
like the Qualcomm Adreno GPU.

Dropping the entire OPP kills clocks, bw and required-opps at once,
but on certain Adrenos we need something like:


disable memory clock (clk)
disable all other clocks, including the opp-managed core clock (clk_bulk)
kill one, fully manually controlled genpd (manual runtime pm)
remove bus vote (func proposed in this patch)
kill another genpd (manual runtime pm)
kill the opp-managed genpd (automatic pm calls)

Changing the order kills the chip until you reboot the whole board and
setting freq=0 using dev_pm_opp_set_rate doesn't drop the bw vote.

Konrad