Skip to content

Commit

Permalink
interconnect: Always call pre_aggregate before aggregate
Browse files Browse the repository at this point in the history
commit 73606ba 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: d3703b3 ("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>
  • Loading branch information
Mike Tipton authored and gregkh committed Aug 12, 2021
1 parent ccfe4f6 commit 22b4917
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/interconnect/core.c
Expand Up @@ -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;
Expand Down

0 comments on commit 22b4917

Please sign in to comment.