aboutsummaryrefslogtreecommitdiff
path: root/drivers/interconnect
diff options
context:
space:
mode:
authorVivek Aknurwar2023-01-13 14:07:59 -0800
committerGeorgi Djakov2023-03-20 16:42:26 +0200
commit558ea12354882bb8250be8ea09a6658af3f7d912 (patch)
treea00c7959c4d0f34467cea689fa6a6a0e96562848 /drivers/interconnect
parent4658842abce4bebb0a0caef53f9c99f0ec4e27e3 (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.c17
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;