summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Tipton <mdtipton@codeaurora.org>2021-07-21 10:54:30 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-12 13:32:25 +0200
commit019387e3c21f16a93c5fd2d2a1a5c4511d828e7b (patch)
tree219636d5b69c66183fea70ddfea3ff17fafdaad2
parent39382972e727dbd4d69427fdedc4fbc25542b46b (diff)
downloadlinux-stable-019387e3c21f16a93c5fd2d2a1a5c4511d828e7b.tar.gz
linux-stable-019387e3c21f16a93c5fd2d2a1a5c4511d828e7b.tar.bz2
linux-stable-019387e3c21f16a93c5fd2d2a1a5c4511d828e7b.zip
interconnect: Always call pre_aggregate before aggregate
commit 73606ba9242f8e32023699b500b7922b4cf2993c upstream. The pre_aggregate callback isn't called in all cases before calling aggregate. Add the missing calls so providers can rely on consistent framework behavior. Fixes: d3703b3e255f ("interconnect: Aggregate before setting initial bandwidth") Signed-off-by: Mike Tipton <mdtipton@codeaurora.org> Link: https://lore.kernel.org/r/20210721175432.2119-3-mdtipton@codeaurora.org Signed-off-by: Georgi Djakov <djakov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/interconnect/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index aeac35ccc097..7887941730db 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -973,9 +973,14 @@ 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);
+
provider->set(node, node);
node->avg_bw = 0;
node->peak_bw = 0;