Re: [PATCH 0/3] opp: Add bw_factor support to adjust bandwidth dynamically

From: Krishna Chaitanya Chundru
Date: Mon Aug 11 2025 - 06:25:00 EST




On 8/11/2025 3:47 PM, Viresh Kumar wrote:
On 11-08-25, 15:35, Krishna Chaitanya Chundru wrote:
Thanks Viresh for the suggestion. We will try this.
Can you confirm this is what you are expecting.

dt change
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -2214,13 +2214,23 @@ opp-2500000 {
opp-hz = /bits/ 64 <2500000>;
required-opps =
<&rpmhpd_opp_low_svs>;
opp-peak-kBps = <250000 1>;
+ opp-level = <1>;
};

- /* GEN 1 x2 and GEN 2 x1 */
+ /* GEN 1 x2 */
opp-5000000 {
opp-hz = /bits/ 64 <5000000>;
required-opps =
<&rpmhpd_opp_low_svs>;
opp-peak-kBps = <500000 1>;
+ opp-level = <1>;
+ };
+
+ /* GEN 2 x1 */
+ opp-5000000 {

The node-name has to be different, but freq can be same. Something
like opp-5000000-N, where N = 1, 2, 3.

+ opp-hz = /bits/ 64 <5000000>;
+ required-opps =
<&rpmhpd_opp_low_svs>;
+ opp-peak-kBps = <500000 1>;
+ opp-level = <2>;
};

And in the driver I need to have a change in OPP framework which
returns OPP based on both frequency and level something like
dev_pm_opp_find_level_freq_exact(struct device *dev,
unsigned int level, unsigned int freq);

I thought you wanted OPP based on freq and bandwidth ? But yeah, a new
OPP API like: dev_pm_opp_find_key_exact(dev, *key);

As we have can have same frequency entries we will select the OPP based
on the level. level will differentiate between different PCIe data rates.

Mani,
Can you check this once and confirm any issues from PCIe perspective.

- Krishna Chaitanya.
where,

struct dev_pm_opp_key {
unsigned long *freq;
unsigned int *level;
unsigned int *bw;
}

and match all non-NULL values only to begin with.