]> git.baikalelectronics.ru Git - kernel.git/commitdiff
interconnect: Do not skip aggregation for disabled paths
authorGeorgi Djakov <georgi.djakov@linaro.org>
Thu, 23 Jul 2020 08:37:34 +0000 (11:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jul 2020 08:45:24 +0000 (10:45 +0200)
When an interconnect path is being disabled, currently we don't aggregate
the requests for it afterwards. But the re-aggregation step shouldn't be
skipped, as it may leave the nodes with outdated bandwidth data. This
outdated data may actually keep the path still enabled and prevent the
device from going into lower power states.

Reported-by: Atul Dhudase <adhudase@codeaurora.org>
Fixes: 218126827dec ("interconnect: Add helpers for enabling/disabling a path")
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Atul Dhudase <adhudase@codeaurora.org>
Reviewed-by: Atul Dhudase <adhudase@codeaurora.org>
Link: https://lore.kernel.org/r/20200721120740.3436-1-georgi.djakov@linaro.org
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Link: https://lore.kernel.org/r/20200723083735.5616-2-georgi.djakov@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/interconnect/core.c

index e5f9987445011a26614fc1f1cba1d17167f65c01..9e1ab701785c72d37ba0adac1d4827c995a770c4 100644 (file)
@@ -243,6 +243,7 @@ static int aggregate_requests(struct icc_node *node)
 {
        struct icc_provider *p = node->provider;
        struct icc_req *r;
+       u32 avg_bw, peak_bw;
 
        node->avg_bw = 0;
        node->peak_bw = 0;
@@ -251,9 +252,14 @@ static int aggregate_requests(struct icc_node *node)
                p->pre_aggregate(node);
 
        hlist_for_each_entry(r, &node->req_list, req_node) {
-               if (!r->enabled)
-                       continue;
-               p->aggregate(node, r->tag, r->avg_bw, r->peak_bw,
+               if (r->enabled) {
+                       avg_bw = r->avg_bw;
+                       peak_bw = r->peak_bw;
+               } else {
+                       avg_bw = 0;
+                       peak_bw = 0;
+               }
+               p->aggregate(node, r->tag, avg_bw, peak_bw,
                             &node->avg_bw, &node->peak_bw);
        }