From patchwork Thu Jul 23 08:37:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 247028 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1278386ilg; Thu, 23 Jul 2020 01:37:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZnP/Q9YPO1JPExlp/TNP/lrhwU408SRrYcTWh0EJpwUVaHclTocRW6oRjWgbC1dAZ1hf+ X-Received: by 2002:a17:906:b813:: with SMTP id dv19mr3222416ejb.119.1595493464616; Thu, 23 Jul 2020 01:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595493464; cv=none; d=google.com; s=arc-20160816; b=pU9ffD0qsA1dOF8qUcm/7kHIuA2ZYytH1jPdtkc7tR/yemFLUqokbFvXxyAtBROp4g zwdtR6upY3OlsR/LtrrcQFxlG+AC9Nbv8/c4bI4habsr2oQ71v1M7hPWpkJuNJZPMe89 RvS4P38EbpiHk73Tr+U1ML7Hd13OLMmNbdlQt1IEgcgT6XUz5pUqoq6F6eWh42Dj1beN x8BQguzgy2ztpbvpFL3Jq5A2mk2O0qjdRRJzAfCektAW6sd3/pjcSvirSr4T4nOSPoPh UiqjM4TA6canxxYtEm6j++UcCZSIzxa2jdTo5J7JbJ0w7BCVsp2sLeG1TsEev8ms869x 84xQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h/yM4jsYCAifUDfs6hudfcj/emQNOmj9c2iS2RlrIxw=; b=PPhY38Zr/+KGslJ/LwO7DIM9YOFebBwF9+v/QsNjuUK5Xmuxc8uwPVmu6/q0zRS5tY MU2f90Gtdsvt/saBSCcnDOkcyRWNe1WONTjMMmpa12U3Uj3WVmEGB2rP22OF24CcdR5k 82DvwV8GY58W3tJOM4D53HKziG3CD59RO5In7BeCqIyLSQcrDbRMVTAUdP9jIK9kTYO5 EmfTs0cu+cfeQST5AkAH1M5XPqDZGK2qV4ZiuagADEYAJh1iKXV3RaQrOS0o9BLlU/rq p12uk7vi8FBZGA+Tc6OC51GFJmEaycEm3zANtTYZAIpQMh/UgWKt+4jMOQzhl9+eFm39 +kkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xpie9hxH; 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 dc14si1467574edb.240.2020.07.23.01.37.44; Thu, 23 Jul 2020 01:37: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=Xpie9hxH; 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 S1727847AbgGWIhk (ORCPT + 10 others); Thu, 23 Jul 2020 04:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727828AbgGWIhj (ORCPT ); Thu, 23 Jul 2020 04:37:39 -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 05EF8C0619DC for ; Thu, 23 Jul 2020 01:37:39 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id q5so4313383wru.6 for ; Thu, 23 Jul 2020 01:37:38 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=h/yM4jsYCAifUDfs6hudfcj/emQNOmj9c2iS2RlrIxw=; b=Xpie9hxHzBq4jxqHPSf9F7wibwb3a9HP3clbkUc00eoy8pjV/W4Mf0LSEbRjtqH3bP dqPWckK3wfcmpHLj9Zw7KsVNCOWjFzwvairARL4+0e1ygnFpI7pNK/izhnUhBYEC2IYC HDgmGON72x4lKUZYVIferkCFvxag4hPQDBnJeXuFLjKJkJLOmHxi2MqnnPCcD4AbDdVP akwbkWbNQq0UeQtVH2kRjdzcRFBbGU3SGXGwopU3tp94lDumwBCLk4+zKOhqTwrTeBPH 4Nx6D0VvaN8qHKyrcz1kCfel3ZNl5mMRqMx/ML11FX0CmmSjpSzYceyucs6iBKTYVO7K JA3A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=h/yM4jsYCAifUDfs6hudfcj/emQNOmj9c2iS2RlrIxw=; b=P/EJoJKBVUfFh6yPBzdGAAFXJ0QKb2yNOS+HU7Ttm9YkWCaT8rXDMR80bnH75dZbGA DEJHBfEMi6nT0YZJSb5lXgDFg/Pc2wqvBbp9lOPymQfKcO+3/ygZBmf0aS/iFRNCvrvM /BpBnO1lywQHauBodo+pGpny8/vfsU0I6imIKDy8R+saadHSQZgQb7Vx6+vAI2y6dod6 GrzfPFg2TrX523Orr41ReJpuv4WhcYvJKnBXbyc7urrJPLtycIRJVUEXTBbW3Kz0Eq+c EIoaGGbtBx3xk6Cx2h8NxV6uoQiJ2gPlDl5fvjE5MPHJCDZz+KlO5WnFD/PddFY4OGiA u91A== X-Gm-Message-State: AOAM533rLbHsh7EreuOHgcR3r1MzHI0DNwzBRcSXiCy2ler+AijbWs2w yn1ZPiLHmSuXxgd0JtctU4dUUTfla7M= X-Received: by 2002:adf:d1b2:: with SMTP id w18mr8808wrc.235.1595493457671; Thu, 23 Jul 2020 01:37:37 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id h11sm3105039wrb.68.2020.07.23.01.37.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2020 01:37:37 -0700 (PDT) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, georgi.djakov@linaro.org, Atul Dhudase , Sibi Sankar Subject: [PATCH 1/2] interconnect: Do not skip aggregation for disabled paths Date: Thu, 23 Jul 2020 11:37:34 +0300 Message-Id: <20200723083735.5616-2-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200723083735.5616-1-georgi.djakov@linaro.org> References: <20200723083735.5616-1-georgi.djakov@linaro.org> 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") Reviewed-by: Sibi Sankar Tested-by: Atul Dhudase Reviewed-by: Atul Dhudase Link: https://lore.kernel.org/r/20200721120740.3436-1-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index e5f998744501..9e1ab701785c 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); }