diff options
author | Vivek Aknurwar | 2023-01-13 14:07:59 -0800 |
---|---|---|
committer | Georgi Djakov | 2023-03-20 16:42:26 +0200 |
commit | 558ea12354882bb8250be8ea09a6658af3f7d912 (patch) | |
tree | a00c7959c4d0f34467cea689fa6a6a0e96562848 /drivers/interconnect | |
parent | 4658842abce4bebb0a0caef53f9c99f0ec4e27e3 (diff) |
interconnect: Skip call into provider if initial bw is zero
Currently framework sets bw even when init bw requirements are zero during
provider registration, thus resulting bulk of set bw to hw.
Avoid this behaviour by skipping provider set bw calls if init bw is zero.
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Link: https://lore.kernel.org/r/1673647679-15216-1-git-send-email-quic_viveka@quicinc.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Diffstat (limited to 'drivers/interconnect')
-rw-r--r-- | drivers/interconnect/core.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 7a24c1444ace..446c9d1fb486 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -981,14 +981,17 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider) node->avg_bw = node->init_avg; node->peak_bw = node->init_peak; - if (provider->pre_aggregate) - provider->pre_aggregate(node); - - if (provider->aggregate) - provider->aggregate(node, 0, node->init_avg, node->init_peak, - &node->avg_bw, &node->peak_bw); + if (node->avg_bw || node->peak_bw) { + if (provider->pre_aggregate) + provider->pre_aggregate(node); + + if (provider->aggregate) + provider->aggregate(node, 0, node->init_avg, node->init_peak, + &node->avg_bw, &node->peak_bw); + if (provider->set) + provider->set(node, node); + } - provider->set(node, node); node->avg_bw = 0; node->peak_bw = 0; |