From patchwork Thu Jul 9 11:07:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 235134 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1297803ilg; Thu, 9 Jul 2020 04:07:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2cOOUx2sz1UTAIyDae0GVJOuDo8eci83ZmpV8kQ1TonzQoQekBJzLURznxWzpsVoKzH+M X-Received: by 2002:a05:6402:706:: with SMTP id w6mr69601572edx.326.1594292838015; Thu, 09 Jul 2020 04:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594292838; cv=none; d=google.com; s=arc-20160816; b=xqdZnvpX1QaKfkx/dqWpGW2y9FqpiBhw8K3a+U4kR3R/SjH+XIDrIWPbAT8JvcMEqu ROpmWZxyzg6aKEAxagkbd5iPFEC7sy8djF9WEnoGjtijLHaB5TaUpRJlGl0aB4rvkuol zC6Li5DYf0YmenusMSVdf98TF7oPbiVpkOkBprXEh2MOHyJQe3MPBes93kc3klUmmG7l 0uOdNs1WGKWgQ5iJ/ISY67KXc3zvYWvxvNGKJ5H35F7Ilma8QaHdzxXhLRDr9XsKFdLl DqlpaYdUDJhu99AFLJcc/Om7YrVDvLeHPS8rXK9DWhTSffklnGbDAik6raBrmn1x1fw4 AO2w== 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=ATfnw728aYA7yiuUsLy6/P7+SZIW7XuVCwpr30Cblyc=; b=TimGA1PQzDA3Rob/UqIGnpX72WbZ+uJtFu9FD5akBSyevUZYNtkLYhC3bNyHG+ZXyZ 4iWHjFxV22UwdV5tJjg845bwhJ+kShvwMRs6nAYCcL/dBGIcFhibNY9BDs1uG27ry6Yc cSMjMmTIoitsMBWB1sZa6CnBow3p9/y6wQfY9Yb3O5EIW0pTbsaE08nIBUU2dNPV/dvb qH0rUGsAQlrKYEmTR0p5fqBq3Vc1I6l6aIi7XCyO6ciZiAZTIfy3Fhhm8Tgs3Y9dYO+x mYKyG08C2eN4WxKmnEHNDoKgR8Hwo6WkpsBcVJQ5x3PxUcwZ+AJjlwNy2VPI7vZQrqxF XjDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HBmfbmco; 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 v14si1746319eje.123.2020.07.09.04.07.17; Thu, 09 Jul 2020 04:07:18 -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=HBmfbmco; 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 S1727802AbgGILHO (ORCPT + 15 others); Thu, 9 Jul 2020 07:07:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbgGILHM (ORCPT ); Thu, 9 Jul 2020 07:07:12 -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 0423AC08C5DC for ; Thu, 9 Jul 2020 04:07:11 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id g10so6015874wmc.1 for ; Thu, 09 Jul 2020 04:07:11 -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=ATfnw728aYA7yiuUsLy6/P7+SZIW7XuVCwpr30Cblyc=; b=HBmfbmcoS3oSP0tUmNy33ILiAMRLDlbvxZLL28SOIIGZF/C+kBzEUCLS7qyeA4kKG3 vEOih1VqibdSZq1YFAnmosKbwgKEHNCdrcv+m6fNf+sHhEw1uS8VPs4HKWvYgYWwfMqI VLqFLLBxuc68NQxsdqxWnD7IX4+4vans68uUZlfQLx8pPjLCzhz2z7ypHzylu2jDCiNG YPDEVoZtr9vTrm7aI+EgsZYl0eXCJI5xYGoQYqZDb4Bw2GX8FItgb2YrNZ0OmT6xBErK 0WNs1DPvuhcgxPGPZvqfcUTD5bAoQe1Y8Z+SuxiHUVsvi5tncEnvbI5Qm8gs2600meGB ECMg== 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=ATfnw728aYA7yiuUsLy6/P7+SZIW7XuVCwpr30Cblyc=; b=QtyINH3G7QUB29SaZCOdiYe9yVrjbpvmMgwNYV9g3xBBIlncWfKJ13Stfy3pURMWxg rsz/18HRfICD+rOTIJ6FfptJhjtOz+DlB7mlkrhtBNwv4Ble0UQXbnnVdMK6EtGCXYI5 wZ/gWL+iZdrg/rO2t2Ivpn579dFUQPMrRb8wPugEeIihPHDCVyj3OG/neqNqD6AoBzHA EYZBM7z4mQtnkSerqCQSYRbdp3BxNk2AAO9cJ0OzW+6GQ2WJwky6HWA6/v2aS3Uqq94m dk6mrj5RGcr88c/R0+XaeeJdt+J9Ni1SbWKePvVV0eZVhowipLKR+rQw6I2yHCvQxg5X f1+w== X-Gm-Message-State: AOAM5328t4mTdv17NKjmC+a5X7Iq7B2v5waiJORLUOOpD1zrI0PI9ShL gD1mMmYcYytrKcj7nSzLXYP5LA== X-Received: by 2002:a1c:9650:: with SMTP id y77mr13540564wmd.101.1594292830479; Thu, 09 Jul 2020 04:07:10 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id q7sm5375578wrs.27.2020.07.09.04.07.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2020 04:07:09 -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, georgi.djakov@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] interconnect: Add sync state support Date: Thu, 9 Jul 2020 14:07:02 +0300 Message-Id: <20200709110705.30359-2-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709110705.30359-1-georgi.djakov@linaro.org> References: <20200709110705.30359-1-georgi.djakov@linaro.org> 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 The bootloaders often do some initial configuration of the interconnects in the system and we want to keep this configuration until all consumers have probed and expressed their bandwidth needs. This is because we don't want to change the configuration by starting to disable unused paths until every user had a chance to request the amount of bandwidth it needs. To accomplish this we will implement an interconnect specific sync_state callback which will synchronize (aggregate and set) the current bandwidth settings when all consumers have been probed. Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 56 +++++++++++++++++++++++++++ include/linux/interconnect-provider.h | 3 ++ 2 files changed, 59 insertions(+) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index e5f998744501..e53adfee1ee3 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -26,6 +26,8 @@ static DEFINE_IDR(icc_idr); static LIST_HEAD(icc_providers); +static int providers_count; +static bool synced_state; static DEFINE_MUTEX(icc_lock); static struct dentry *icc_debugfs_dir; @@ -255,6 +257,10 @@ static int aggregate_requests(struct icc_node *node) continue; p->aggregate(node, r->tag, r->avg_bw, r->peak_bw, &node->avg_bw, &node->peak_bw); + + /* during boot use the initial bandwidth as a floor value */ + if (!synced_state) + node->peak_bw = max(node->peak_bw, node->init_bw); } return 0; @@ -919,6 +925,12 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider) node->provider = provider; list_add_tail(&node->node_list, &provider->nodes); + /* get the bandwidth value and sync it with the hardware */ + if (node->init_bw && provider->set) { + node->peak_bw = node->init_bw; + provider->set(node, node); + } + mutex_unlock(&icc_lock); } EXPORT_SYMBOL_GPL(icc_node_add); @@ -1014,8 +1026,52 @@ int icc_provider_del(struct icc_provider *provider) } EXPORT_SYMBOL_GPL(icc_provider_del); +static int of_count_icc_providers(struct device_node *np) +{ + struct device_node *child; + int count = 0; + + for_each_available_child_of_node(np, child) { + if (of_property_read_bool(child, "#interconnect-cells")) + count++; + count += of_count_icc_providers(child); + } + of_node_put(np); + + return count; +} + +void icc_sync_state(struct device *dev) +{ + struct icc_provider *p; + struct icc_node *n; + static int count; + + count++; + + if (count < providers_count) + return; + + mutex_lock(&icc_lock); + list_for_each_entry(p, &icc_providers, provider_list) { + dev_dbg(p->dev, "interconnect provider is in synced state\n"); + list_for_each_entry(n, &p->nodes, node_list) { + aggregate_requests(n); + p->set(n, n); + } + } + mutex_unlock(&icc_lock); + synced_state = true; +} +EXPORT_SYMBOL_GPL(icc_sync_state); + static int __init icc_init(void) { + struct device_node *root = of_find_node_by_path("/"); + + providers_count = of_count_icc_providers(root); + of_node_put(root); + icc_debugfs_dir = debugfs_create_dir("interconnect", NULL); debugfs_create_file("interconnect_summary", 0444, icc_debugfs_dir, NULL, &icc_summary_fops); diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index 0c494534b4d3..153fb7616f96 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -71,6 +71,7 @@ struct icc_provider { * @req_list: a list of QoS constraint requests associated with this node * @avg_bw: aggregated value of average bandwidth requests from all consumers * @peak_bw: aggregated value of peak bandwidth requests from all consumers + * @init_bw: the bandwidth value that is read from the hardware during init * @data: pointer to private data */ struct icc_node { @@ -87,6 +88,7 @@ struct icc_node { struct hlist_head req_list; u32 avg_bw; u32 peak_bw; + u32 init_bw; void *data; }; @@ -103,6 +105,7 @@ void icc_node_del(struct icc_node *node); int icc_nodes_remove(struct icc_provider *provider); int icc_provider_add(struct icc_provider *provider); int icc_provider_del(struct icc_provider *provider); +void icc_sync_state(struct device *dev); #else From patchwork Thu Jul 9 11:07:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 235137 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1297990ilg; Thu, 9 Jul 2020 04:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdoYsz2odEcEV80mbu2MnDzFqmzI7gbj5B2P/hVCJmU9k8kyL0tkZKiXVX5eRLVlYq9sDn X-Received: by 2002:a05:6402:164f:: with SMTP id s15mr72135027edx.239.1594292850863; Thu, 09 Jul 2020 04:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594292850; cv=none; d=google.com; s=arc-20160816; b=lGnCqskp0ZDbTLIKOEwoK1TSS7Mt0/WnXsTsIVsU8xjPAtkYrrh9+fdK33bAHoLSi3 Iy1z7LpXrSu11CdsJoFyvkV9ev4pyHqEESBKsiq48+mxzfJ7TGG+rI/Y5SPtEqrxfi2N W07mLzE+n7kFL+3t3uwg28dxgcmhqPQz0/Ak+9b9h0cnFi6efhHOdhJWIezbvILNAQDL scW8eEGXfC2XayUEm5efycxBbc3PXtCa2nYHTcbyglwYfQVqnHbPnOnxqdftd2wxMmm0 bQoAb/Fu7rJN9XSEWdd7xWwzusiN5P5DI4XppfkH9gCNL92XOjUVs87Zje1iJA7OH6gl cIOg== 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=5ypoS87uaYq5T1Ws5fpzwvYaFzn2rohMM1mgqyify3Q=; b=mhUrhg/cWR6ZKyVAOh7oRaLtpP4Fj0cc49uPiS2dwLyLqos5RtR8BT8azA/Ko9XQ4I N0pyJ85H9BmDYF7DVTF8CWwhFcVEyWYxgMuZF6enzlEIiaq47DCGWhhQfLLU3JG3JZTB 17ri3Zz1JaQTF+E+FnzLhCyC0a4ZAT9rV+2tz1zAcJKuEgTOh9QJeD6XGacTVGIAwHF/ 7rg5f4abM3e/0w7gML7kjL1ZQFQtofjLrp3d2xyrwsaCLdL/55pPckiWa8c1NvEUTqPI ScBpuTb9wUP+S8cKmmof+joaSJhMuSzfVa6lrmwQxHWKQir0UgfL444hE5PNVGmcTPkx Uz1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u/XQOJpR"; 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 br6si1658518ejb.203.2020.07.09.04.07.30; Thu, 09 Jul 2020 04:07:30 -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="u/XQOJpR"; 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 S1727814AbgGILH1 (ORCPT + 15 others); Thu, 9 Jul 2020 07:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbgGILHP (ORCPT ); Thu, 9 Jul 2020 07:07:15 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B1C6C08C5CE for ; Thu, 9 Jul 2020 04:07:15 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id b6so1871906wrs.11 for ; Thu, 09 Jul 2020 04:07:15 -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=5ypoS87uaYq5T1Ws5fpzwvYaFzn2rohMM1mgqyify3Q=; b=u/XQOJpRlPYAfkZQd67a8cfGanswI8V5QVehHkfbrFzIMDDe0G/ernaRhEM4XLh0VC 1GK4E3PfbGomGPDfaaJE/ffo/sQHtkVUj8fUdmFGFSDzodzZIke5XoA7TiKcp2kJYn2D 2p4DEap+OAMeKDUMYLuEfoX0En8TMCKA/YpyjvtsSgnn+UUahU+4zp5q35GbSeSOxAfp GZFccHLnYqs0qkaJO8Ja3hOyKS2hr6KbQzU44JNMdkjSIG3RSkwYxKBPTfhUqF7DiwB0 /T8Gd779ciLnWaVL1UbYzbqDN/dV5O/mmxeJ/QUbZC7sWQp6UTZjp+VEApofs3CSFGQB MrLA== 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=5ypoS87uaYq5T1Ws5fpzwvYaFzn2rohMM1mgqyify3Q=; b=DLj0l5AMURUX1Y3I+1fcN50K1nQpRp585fXHmRPIMz9O65LthdtVYzpAVk4kiXyjkl v3GRJTQI7kxeqCH2SaTXQ7i5CHJeqOsxiTGf4V5yHzcp726Z93Ip9OnpG3LsOvx+B9XA dTAAqDk5cXF2vFkem9y2Y0ws/Y0OW8u2KaqNA/lB3SM7UUHDkGNkNxn4YEh1fce5K5fr fD0qUI/ZPNZRrMTdmkQh3R2yEX6Y1G38ZqoRXRTDKZGAXHPP1g5V+yMc7cn07n6uqBGF JnfquG/2U70WeG8j2fdByhJjSpredsQ5yOfFqSwwlxQ6pkuq1KECE1aulsUimB8dJUNY eJ+A== X-Gm-Message-State: AOAM532c6+x4+DcPujbUH63tE/sS+Ut9mjHBl7vdySJ54ulyDAv1mswe 7YNnPgm1riJpi3DJmQklGJUvA/Y1A/c= X-Received: by 2002:a5d:504b:: with SMTP id h11mr61368817wrt.160.1594292833936; Thu, 09 Jul 2020 04:07:13 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id q7sm5375578wrs.27.2020.07.09.04.07.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2020 04:07:13 -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, georgi.djakov@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] interconnect: qcom: smd845: Use icc_sync_state Date: Thu, 9 Jul 2020 14:07:04 +0300 Message-Id: <20200709110705.30359-4-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709110705.30359-1-georgi.djakov@linaro.org> References: <20200709110705.30359-1-georgi.djakov@linaro.org> 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 Lowering the bandwidth on the bus might have negative consequences if it's done before all consumers had a chance to cast their vote. Let's return the maximum amount of bandwidth as initial value. This bandwidth level would be maintained until all consumers have probed. Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/sdm845.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index f6c7b969520d..bfea6a5321b0 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -437,6 +437,13 @@ static const struct qcom_icc_desc sdm845_system_noc = { .num_bcms = ARRAY_SIZE(system_noc_bcms), }; +static int qcom_get_bw(struct icc_node *node, u32 *bw) +{ + *bw = INT_MAX; + + return 0; +} + static int qnoc_probe(struct platform_device *pdev) { const struct qcom_icc_desc *desc; @@ -469,6 +476,7 @@ static int qnoc_probe(struct platform_device *pdev) provider->set = qcom_icc_set; provider->pre_aggregate = qcom_icc_pre_aggregate; provider->aggregate = qcom_icc_aggregate; + provider->get_bw = qcom_get_bw; provider->xlate = of_icc_xlate_onecell; INIT_LIST_HEAD(&provider->nodes); provider->data = data; @@ -559,6 +567,7 @@ static struct platform_driver qnoc_driver = { .driver = { .name = "qnoc-sdm845", .of_match_table = qnoc_of_match, + .sync_state = icc_sync_state, }, }; module_platform_driver(qnoc_driver); From patchwork Thu Jul 9 11:07:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 235135 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1297942ilg; Thu, 9 Jul 2020 04:07:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlg2Kucl5W/VbCKitYE3PYAd2YuOCks9xLp4CDoqkXbw3/zsTnWFjZXZ0u2qIhyLrRc7nw X-Received: by 2002:a17:906:eb93:: with SMTP id mh19mr54468188ejb.552.1594292848436; Thu, 09 Jul 2020 04:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594292848; cv=none; d=google.com; s=arc-20160816; b=yBU2hsYQelKzttXL22NM6eewKdtGiyRtvwVhE9HETJXz9Kary54CX+l8bRwfgjwscQ Emj0PzjsDaOefIbd9jCswl2FFYpRH3YH+r3ySPU/9Sw933fJvB4/pHKxUAxCgzzDVK1x N5/Ax+DzI3jAZ2XXi+zsowfax8R8Se8kE75YJXZOWwCGToqHCXhnUQM0naXrcDoADfUl i4SXmuyjzgVvgzT5WtMwbW2CV/+QrxlsUm8jt51wq8vK3YG1hADNuqPkH41PR90/egRy XLvrfC6xgYABBh5StFa5r8R16FJdCsU5RiOCVKMXm6+vHe4mn57qUc1oNZ/EIHxvGVuv D+VA== 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=fdwvmHFIIgaNnK77Gxh46Dh+4af85NxewdzZf8almyY=; b=LmT+QmlwdYBpnaKpFm3is+nZ7OWvQusWM6L3XekIU74ErnZULr+POnRNwnzwHYECWo oSL4AqEjxFSvyVMR1pk5Bu227x4jMAX5Wfqp7Qvf/+iY5Ivy/juQ6DDobxDgACN7AxsH yFJTwWXP7jUz4/CnHywYyLSkiOuG3hWfUJbuyRqMXYpSqCF9j/Qdk73XR9rFiebwugjK lfhjCloY5vqNFVUjlo2SSSqgktbreeHps50kyGtOdpoduS0DmKpAyuevuWWL+gEXRp/m fLnySUs/yvfehQGfFtLnwcXr+WHoKSRJMqTxgl+U96lJWPU8rP1YV2dlmMZwDDef4PeX D6ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F3BGIIIx; 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 br6si1658518ejb.203.2020.07.09.04.07.28; Thu, 09 Jul 2020 04:07:28 -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=F3BGIIIx; 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 S1727839AbgGILHX (ORCPT + 15 others); Thu, 9 Jul 2020 07:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727798AbgGILHR (ORCPT ); Thu, 9 Jul 2020 07:07:17 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0134CC08C5DD for ; Thu, 9 Jul 2020 04:07:16 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q15so1362264wmj.2 for ; Thu, 09 Jul 2020 04:07:16 -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=fdwvmHFIIgaNnK77Gxh46Dh+4af85NxewdzZf8almyY=; b=F3BGIIIxCLIBykFtP/eblriQzi1cjmRAs1xHNnvelohkNmxSQjuae+kOtSwEJE17hJ mRgWwk9Xpqw1iQEgw16Kj49km1fIluo72cMIe7ktEfxD7FiS3lthmE9xWf8OT5UrO+8A HXPBdgCopczix3rGZU9Ck+wiFcSmW9XRpF2erZh9jcjcwNDH3HrYlGC93LP0MVi0gOjS JIoInn6K6liNXjY7Euw2fyt1co+efyLYSyIwxnqiq+Aj6sqBOm1yKBtPLm+8C25Q+rIU 5IXO3eVcsk07Icu+FspMyvR28i4wP9cchjooabnObW2tgTtLAsG/oUZUmNMsOQBwULRB XVJQ== 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=fdwvmHFIIgaNnK77Gxh46Dh+4af85NxewdzZf8almyY=; b=Jyxr9XTeMu7+PnF6BBe6oa3gNBVuZlyZT+nR1Lp4Xp9okHuCFycCR4dEsnMfha8RkZ L1OR03fUM2TiUknE0gqx2AcIh+5jRPtcvBqfhq8UAKLuK4NjiZbZTNCz/aGVT5iRANHO bueuTP+82IGv06Pp0rXa+s1MhSIS3TtjX/LqiOP7mmXxTJ2MSNljiqoSnsvVeWCej2SS jD9VDEzN5mC4ZIn71Tdd8HB3m1cFTepfswiK2EbBiG8SN63Qs1YuB7hLWH11KduyK3h7 HLrG/tbqlLHSbM4v8/Ivqt105TJYGCV1rryMpARin3dur+YeBMaukbrYFmSwYF+J1+eX K0GA== X-Gm-Message-State: AOAM530IcYalUGNPj31izeo6W2jRrbZl9SaAM7Y5LLyTDWBUqAzEb/MC E/VJV+hR27NxJ8p4nW5keNmUew== X-Received: by 2002:a1c:9911:: with SMTP id b17mr13164196wme.135.1594292835740; Thu, 09 Jul 2020 04:07:15 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id q7sm5375578wrs.27.2020.07.09.04.07.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2020 04:07:15 -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, georgi.djakov@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] interconnect: qcom: osm-l3: Use icc_sync_state Date: Thu, 9 Jul 2020 14:07:05 +0300 Message-Id: <20200709110705.30359-5-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709110705.30359-1-georgi.djakov@linaro.org> References: <20200709110705.30359-1-georgi.djakov@linaro.org> 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 Lowering the bandwidth on the bus might have negative consequences if it's done before all consumers had a chance to cast their vote. Let's return the maximum amount of bandwidth as initial value. This bandwidth level would be maintained until all consumers have probed. Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/osm-l3.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/interconnect/qcom/osm-l3.c b/drivers/interconnect/qcom/osm-l3.c index 96fb9ff5ff2e..532d541b71be 100644 --- a/drivers/interconnect/qcom/osm-l3.c +++ b/drivers/interconnect/qcom/osm-l3.c @@ -137,6 +137,13 @@ static int qcom_osm_l3_remove(struct platform_device *pdev) return icc_provider_del(&qp->provider); } +static int qcom_osm_l3_get_bw(struct icc_node *node, u32 *bw) +{ + *bw = INT_MAX; + + return 0; +} + static int qcom_osm_l3_probe(struct platform_device *pdev) { u32 info, src, lval, i, prev_freq = 0, freq; @@ -215,6 +222,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev) provider->dev = &pdev->dev; provider->set = qcom_icc_set; provider->aggregate = icc_std_aggregate; + provider->get_bw = qcom_osm_l3_get_bw; provider->xlate = of_icc_xlate_onecell; INIT_LIST_HEAD(&provider->nodes); provider->data = data; @@ -268,6 +276,7 @@ static struct platform_driver osm_l3_driver = { .driver = { .name = "osm-l3", .of_match_table = osm_l3_of_match, + .sync_state = icc_sync_state, }, }; module_platform_driver(osm_l3_driver);