From patchwork Tue Aug 25 17:01:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 248255 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp3604600ils; Tue, 25 Aug 2020 10:02:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzarEp1qwsbcQXYqQM1RLOYrIF+Vnx7WiXES6eNdyAiB/+bcmS08RCRNS7IwSxTNegcDbwg X-Received: by 2002:a05:6402:54c:: with SMTP id i12mr10969421edx.358.1598374935763; Tue, 25 Aug 2020 10:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598374935; cv=none; d=google.com; s=arc-20160816; b=UQRe/kEmQFDCrv8moeKktGN1xk//5iXSk69kc9/MEibtI4UhK55Ty3rqvIqtVahDJD PbkBoNlk1l3c06n0YKSovFEJegN/kN99+oy94VdW7Gh9ig85wqW8bgIoqWRw2qhmCWMC fcRzUzDsG2as3yWMXCOGqeVST+Jz544mYMp47eZwUXcjJyOyRJQJ9c8bGEr3Kxt37/bN thWCP8vgTwsnLr9pTtDg07+6zX9M6URI+Dwx6dR0DeeKo5IjYEyV7K0Ibot/CS11ct9l pTVYJizK4HyRf8vEsyOS2vUbHUdMnGewOw8gDt2NI1G4B+geMd6dt5vhIaAdyybuvRNO 2cuw== 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=rpKO1n0QanBgjBcMclGlpuxhhM/1GVFlZi03A2YqmvY=; b=ew2uzcXTHkKvwCTSXuAI4lOCtbrtk1DHXffpALnLCZsomdDlZiRX4Qm6EbrU7p6ArA nMurz+91Y/rW2l5flZGRqs81OmsBgf0lb8/AewEI3PM6ltaxIYYRE3x9hZYLgz0dOw8U RRIx7SpcfXBJEmvIPi4Y0vj4/NZq+GEfgYSXcFe4QU410FVf6b/BuY4oS5RukAOXbUS9 2xMdbRCVfxHuzcjXQhuCKDl1lkSjNYSqq0mUuYGOXiWAen4OKjoSSrymGEMadc3Gc1Jp FC9V6KoTlCok4WS/QMVXLSVJOYSVpaoqWwxdYJirTHPH017FKFAGJU4f6uznQyPy0tPY wStg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M+RkbNAF; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 co24si656984edb.316.2020.08.25.10.02.02; Tue, 25 Aug 2020 10:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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=M+RkbNAF; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726466AbgHYRB5 (ORCPT + 15 others); Tue, 25 Aug 2020 13:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbgHYRBz (ORCPT ); Tue, 25 Aug 2020 13:01:55 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E015C061574 for ; Tue, 25 Aug 2020 10:01:55 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id t2so3255298wma.0 for ; Tue, 25 Aug 2020 10:01:55 -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=rpKO1n0QanBgjBcMclGlpuxhhM/1GVFlZi03A2YqmvY=; b=M+RkbNAFYMBm5BznXBwWgdcU8fHg3/Plxeo7geh65W6uhfjeWskcp1RMI0yxk6ANgp lTWk7LNPF8ElsHi2hCy+w/nyedqZxLdq1usGzYOtKvq9yBs9AfGtnxAqs/YF/yVOO74S A2WeolrcChlt6ckXcvUDGkF5xuWZPKpcWFNkiwnFVoEd3LUyFs9nuZS2HdgVYsKGnMcG 7zej4HWNccEQw0C8UWiH76pTZhB1ioRXPCHJcczW2TmdNAYFuTf04VH+7EFFZ0D5vKSQ /hna1rSAi1Dqxj1P7ocxPHqaYBxko4jimqNRV+suoPuyqBaenyEIc/NyxwxuLg/uWvTU Y72g== 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=rpKO1n0QanBgjBcMclGlpuxhhM/1GVFlZi03A2YqmvY=; b=IXHyKog0NeNFzIAKuwy38HYKSTc6RgG+3SsOWWGJArk4aHJUdnvPuwOLz6bY3QdR3d +eT/yFCn8jTS9zmbOfk9Nwdg0FU906M8w5VJ21sBJNYlkf4PXJSSaYq569oz/AmxwC7r 3j6SgV0apTMIiiB4pCbt0cj7DwVfiyp53HXWbpa2w+YRdyodPig7Qh/ZB9oR9SX4aBHO ZSQMHsPXFoZii9yQ9vpgdIYR4o+qAU6djhr5u6pY+vrbMMyJ6FFlGjp83eEJKmSZyXkI PA4wN3BHcCUQ0X50qjlcj1+FpyOu1cxqLaE03oAoczbhWRosUZ/PDh/ODYGuy4+os7rg 3PZg== X-Gm-Message-State: AOAM531UdgHs9jYlozw4PE9HqaP03aYb1nyKrZAeOt4bHcu5Wae0pf1S FfNl4cyNqQ6u8GVR9xtBoeGahA== X-Received: by 2002:a1c:2dcb:: with SMTP id t194mr2821188wmt.94.1598374913846; Tue, 25 Aug 2020 10:01:53 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y17sm6669008wma.17.2020.08.25.10.01.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2020 10:01:53 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: saravanak@google.com, mdtipton@codeaurora.org, okukatla@codeaurora.org, bjorn.andersson@linaro.org, vincent.guittot@linaro.org, akashast@codeaurora.org, georgi.djakov@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] Add interconnect sync state support Date: Tue, 25 Aug 2020 20:01:49 +0300 Message-Id: <20200825170152.6434-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Bootloaders often leave some system resources enabled such as clocks, regulators, interconnects etc. We want to keep these resources enabled until all their consumers are probed. These resources are often shared, so we must wait for all the consumers to come up, before deciding whether to turn them off or change the configuration. This patchset is trying to solve the above problem just for the on-chip interconnects. The problem is solved by allowing the providers to implement the get_bw() function which should return the current average/peak bandwidth. These are used as floor values, that are enforced during boot while the requests from all consumers are being collected. Then the sync_state() callback is used to signal that all consumers have been probed, meaning that the floor bandwidth is not needed anymore and the framework is ready to re-aggregate and process all requests. If get_bw() is not implemented, the framework will use INT_MAX as default bandwidth value. v3: * Go back to introducing the get_bw() function as in v1. (Saravana) * If querying the current bandwidth is not supported, max out the bandwidth. (Saravana) * Use icc_sync_state also for sc7180. v2: https://lore.kernel.org/r/20200722110139.24778-1-georgi.djakov@linaro.org/ * Support initial values for both average and peak bandwidth (Mike) * Skip aggregating/setting for nodes that don't specify initial bw (Mike) * Drop patch 2/4: Add get_bw() callback (Mike) * Squash patches 3 and 4. v1: https://lore.kernel.org/lkml/20200709110705.30359-1-georgi.djakov@linaro.org/ Georgi Djakov (3): interconnect: Add get_bw() callback interconnect: Add sync state support interconnect: qcom: Use icc_sync_state drivers/interconnect/core.c | 67 +++++++++++++++++++++++++++ drivers/interconnect/qcom/osm-l3.c | 1 + drivers/interconnect/qcom/sc7180.c | 1 + drivers/interconnect/qcom/sdm845.c | 1 + include/linux/interconnect-provider.h | 7 +++ 5 files changed, 77 insertions(+) Reviewed-by: Saravana Kannan