]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
interconnect: Aggregate before setting initial bandwidth
authorGeorgi Djakov <georgi.djakov@linaro.org>
Tue, 13 Oct 2020 13:59:11 +0000 (16:59 +0300)
committerGeorgi Djakov <georgi.djakov@linaro.org>
Thu, 15 Oct 2020 06:24:00 +0000 (09:24 +0300)
When setting the initial bandwidth, make sure to call the aggregate()
function (if such is implemented for the current provider), to handle
cases when data needs to be aggregated first.

Fixes: b1d681d8d324 ("interconnect: Add sync state support")
Acked-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20201013135913.29059-1-georgi.djakov@linaro.org
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
drivers/interconnect/core.c

index eea47b4c84aa779e23a663eb1e6c7ec0f3a8246f..974a66725d094f4700f1e362d2afb50c941ae666 100644 (file)
@@ -971,6 +971,9 @@ 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->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;