[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1673647679-15216-1-git-send-email-quic_viveka@quicinc.com>
Date: Fri, 13 Jan 2023 14:07:59 -0800
From: Vivek Aknurwar <quic_viveka@...cinc.com>
To: <djakov@...nel.org>
CC: <quic_mdtipton@...cinc.com>, <quic_okukatla@...cinc.com>,
<linux-pm@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Vivek Aknurwar <quic_viveka@...cinc.com>
Subject: [PATCH] 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@...cinc.com>
---
drivers/interconnect/core.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 25debde..43ed595 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -977,14 +977,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;
--
2.7.4
Powered by blists - more mailing lists