From patchwork Tue Jul 21 12:07:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 246632 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2856046ilg; Tue, 21 Jul 2020 05:07:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypCev17eg3XGAjUQJiJHr21pMv7itA661v964HbBLIAnjiUbrvYkn4Jkegww7vWkcCRSQK X-Received: by 2002:a17:906:6959:: with SMTP id c25mr24381006ejs.375.1595333264106; Tue, 21 Jul 2020 05:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595333264; cv=none; d=google.com; s=arc-20160816; b=Sz8ACUPXgEuIGXq5QsOQKqDe474YX0CTSESV4COYUDEaaPX6lZWV6zFY86kGQfXbWq fGBpkp3NmSGh868nQfWNmMi9OwJR5DCNM6AuQZlXtTaG5omDvJiiDQEo7AsA+dKkyGkm PHI0LFkAA2hpAG5OGNek0UWYnfA4vshGnqbPKLjH0i0rvy+/E0piaxr0jFjnM5+OYwBH 9WjkP75rPnIOYsvuAjTqpQw/ODm0SdoBUcZNs/OsLR8Ctb1fpx5k8UCkfUBnPOsgWKK7 yQX6/DE8ZsR8Qxg+PoVUKPV/C5lIV7fkS5W0X0znoAu60FfxNtQBumnzf4hGfjpGx+B4 4T9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=npznphlDVv95ehRrHa25K6/37D7lyoH9vNDTfyrHV8o=; b=wCnqBDgUJU4yZ6Wqa+3OmuIsgEyFlJvv6jJBMilPe5H20P4W50HdK7VafnyWtq9MBu nDIjFHmaQ5kkR+ynPcMTvKYj8uf8CxMV6ddB8XnoF6vBY7aofAb2+duuUaB8gVNZrUV5 nKRDSWoH5Y6zoN1DGVbF0DhyMF2tssFUePCaJF95XkxjyA1QvRoB9meDyVc2Qv3OSeRy 3UNyzSTNzWSLXU2tPVF54U0hSIXiBFeK3FLReZd0xfP6gNHBjQ/4Dc5PO53LbzfMhTYz nBsl0dST5RKJU/0vr3VH8jH6i2l0gpRqJA7bZacX1qT7ZvLCEdqa0ksZOp4o3nj4mtyi FToQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ib1bZOSQ; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz22si12193638edb.148.2020.07.21.05.07.43; Tue, 21 Jul 2020 05:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ib1bZOSQ; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbgGUMHm (ORCPT + 10 others); Tue, 21 Jul 2020 08:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726919AbgGUMHm (ORCPT ); Tue, 21 Jul 2020 08:07:42 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5451CC0619D8 for ; Tue, 21 Jul 2020 05:07:42 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id a15so6006784wrh.10 for ; Tue, 21 Jul 2020 05:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=npznphlDVv95ehRrHa25K6/37D7lyoH9vNDTfyrHV8o=; b=Ib1bZOSQY4liaBprcJTobQOsSM1ujiVEYXJWHQqVGnvE4yv0tHq72tpitVyrD3KM6D ZrTcl+yJEVDMxpdpHRtRa5pIC4GvuWfR+2+4Kkfc7Pkq+2cd/islUOLAEKsAXWuHuEXi qaf82L42Fbi1gMCgtsOZY7d1sw2NXVJRNaCK9TKvrHp4pwZcR0tGxl+AOqh8/7VKP2Z6 o0fR69XozX1GzaPPQFayryxG/6uFGvKUPT4eXMAZZkdAp6Ur2EIztAXnsrAUYK9BNS43 AiXaeHFqem370oI8xXpUlzQ+4KrVLNuwvbw+Cjw1QybNmoEp8QJ0LfyTqaihMQOcopU8 tmCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=npznphlDVv95ehRrHa25K6/37D7lyoH9vNDTfyrHV8o=; b=PM9UaJy7VQNAiPWotyMxSXrYxxyUtBY7QRtvye+gH77k0W0nVO+tpaPVLadzq2jS8T nDl8IXq7n6RCHQpAAQE4w5bGyU8mMzqIaEYEe56i+uXb9CYtG9hRXiUxHouEyC1a7NlF Ipy/TCAVMkUkXuNSd5WBF64YZQ6WRQSZUkpEhbR+OgowjGDW0aW/dTfH3AOQh6pHj1Zv puqojH0DWYa6ToAiKL6uoD5p6f3RKJ03Lml/P1vGz+Ag8aVieucwQ1XC9gLi2Pn7whp7 PxmQBVsEZFReOnmVDyNP9anqABY41pX2hAQISAdRaqxTd0RZ5NMNkaXkPoqoj7ePp0Sd jslg== X-Gm-Message-State: AOAM530XOm/dCk5ojjn9VnaQFozPpg5KWIJnuznCaHXsQQy31QpE3w24 1x8SRYMkstDOsVGKsEKjfzvtSPg4Ljk= X-Received: by 2002:adf:f488:: with SMTP id l8mr11938771wro.123.1595333260721; Tue, 21 Jul 2020 05:07:40 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id b10sm3057151wmj.30.2020.07.21.05.07.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 05:07:40 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: adhudase@codeaurora.org, okukatla@codeaurora.org, mka@chromium.org, linux-kernel@vger.kernel.org, Georgi Djakov Subject: [PATCH] interconnect: Do not skip aggregation for disabled paths Date: Tue, 21 Jul 2020 15:07:40 +0300 Message-Id: <20200721120740.3436-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Fixes: 7d374b209083 ("interconnect: Add helpers for enabling/disabling a path") Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) Reviewed-by: Sibi Sankar Tested-by: Atul Dhudase Reviewed-by: Atul Dhudase diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 37d5ec970cc1..5174dcb31ab7 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -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); }