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: 11654253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B8FF6C1 for ; Thu, 9 Jul 2020 11:07:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 228EE20772 for ; Thu, 9 Jul 2020 11:07:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HBmfbmco" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727802AbgGILHO (ORCPT ); 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-Google-Smtp-Source: ABdhPJy638SANQ1lHws0vfG/w0IRWANsMDY7dasDL0vdZGK91DujiB9ZfLBEesPo3yzxE7p1FQd9og== 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:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11654261 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FE1F913 for ; Thu, 9 Jul 2020 11:07:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB7CA20772 for ; Thu, 9 Jul 2020 11:07:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="miAQ6xvF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbgGILHQ (ORCPT ); Thu, 9 Jul 2020 07:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbgGILHN (ORCPT ); Thu, 9 Jul 2020 07:07:13 -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 8D8D0C061A0B for ; Thu, 9 Jul 2020 04:07:13 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id s10so1859777wrw.12 for ; Thu, 09 Jul 2020 04:07:13 -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=QO3JZKihtso+39nMH2ykv6IniQvYNe/2WheGTzYpPuE=; b=miAQ6xvFBcDyc81YMANaoJ8Vj2T+Y6Y4oRgP4DbaKNUZ60jc3Qw5eTnj/8OtFHT9Fw uUD2LrGi6v1GF4Ec9zvV9DwiO0ym1tgQmXcJancBs4W3QengAkduEuW2v+fTrFqqgsge G84AfYwE3GEp4Tx18wngoP8y20BwEbFYuJX6g5vqabGW7kTrWJGHebcQr6b1w3zwCWep ibchTQ4ucOuKtxwNWcEd/nHpzH5hUsk+hz3y1WIx/0veCqUpm7l3n3lcnj7ArlyPkBOx U0XpHZsh+Z1vVze0HNdaJH4fut7gQ6KAUayCYYNsTzUIPEGZmyb8kVfeD9wmZ5EWCoYD MaFw== 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=QO3JZKihtso+39nMH2ykv6IniQvYNe/2WheGTzYpPuE=; b=QR13+TccMZ6pvyRwr0QFwMfMN4/MEH0mEnHF6OYXYaZIcfDbhJ/lI1Ao573jNZhnSp W+Cn8DomYlNcAO4IxaVMrTcu16S2CPo+J4Rf4iRByzrOAki3HtbdKzDQopNnueWpGyDZ EVu6z2HS4lIk54N8aNz+CWHtYaD1BnfHgLVxWqtCQyvDpY1xgcCXcrrwI0oJFEKG1JCH 0VRP50rhIPY+3IUvlBytQZDzEeO9l4ulVz0TUpby7DpM+DZIYOv3OgckO8lk7EwJadYT J1qEeqjIl5vfjjsztyY9YdgMb4i6bVoIVA8lQgBJuLLpYXwpVBIL2gOssvv1UBM2eM+A xaoA== X-Gm-Message-State: AOAM531Jq49Ns5VJDekZYmQL7jWjVmGwgIt7Kow6/kuhmn96P/9Jwqj8 m7es2/Hgs3eY0plkOPBC6koICg== X-Google-Smtp-Source: ABdhPJycuHP4XE2SNs40fwWrwO9C5q8Tgb1PQeOiKtcis5BE5sARpF1cQMXUcm3zUnHxLMZQhSYXig== X-Received: by 2002:adf:e944:: with SMTP id m4mr64207464wrn.252.1594292832314; Thu, 09 Jul 2020 04:07:12 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id q7sm5375578wrs.27.2020.07.09.04.07.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2020 04:07:11 -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 2/4] interconnect: Add get_bw() callback Date: Thu, 9 Jul 2020 14:07:03 +0300 Message-Id: <20200709110705.30359-3-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 interconnect controller hardware may support querying the current bandwidth settings, so add a callback for providers to implement this functionality if supported. Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 3 ++- include/linux/interconnect-provider.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index e53adfee1ee3..edbfe8380e83 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -926,7 +926,8 @@ void icc_node_add(struct icc_node *node, struct icc_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) { + if (provider->get_bw && provider->set) { + provider->get_bw(node, &node->init_bw); node->peak_bw = node->init_bw; provider->set(node, node); } diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index 153fb7616f96..329eccb19f58 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -38,6 +38,7 @@ struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec, * @aggregate: pointer to device specific aggregate operation function * @pre_aggregate: pointer to device specific function that is called * before the aggregation begins (optional) + * @get_bw: pointer to device specific function to get current bandwidth * @xlate: provider-specific callback for mapping nodes from phandle arguments * @dev: the device this interconnect provider belongs to * @users: count of active users @@ -50,6 +51,7 @@ struct icc_provider { int (*aggregate)(struct icc_node *node, u32 tag, u32 avg_bw, u32 peak_bw, u32 *agg_avg, u32 *agg_peak); void (*pre_aggregate)(struct icc_node *node); + int (*get_bw)(struct icc_node *node, u32 *bw); struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data); struct device *dev; int users; 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: 11654265 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B26F41709 for ; Thu, 9 Jul 2020 11:07:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96DE820772 for ; Thu, 9 Jul 2020 11:07:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="u/XQOJpR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbgGILH1 (ORCPT ); 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-Google-Smtp-Source: ABdhPJynWNpStYFUrVfAdO0LvBqdBvKmYX7eIbfu3UeYFpdUQ3gByC7usDKxfX5IOl3P6cYXTes0CA== 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: 11654255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D21616C1 for ; Thu, 9 Jul 2020 11:07:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB0D4207DD for ; Thu, 9 Jul 2020 11:07:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="F3BGIIIx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbgGILHX (ORCPT ); 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-Google-Smtp-Source: ABdhPJyzyO6OJ0n74t6D1mB7vLxMXi4nDrnvEj3LRHpoi/iVMt8GDCSwSYvn6vh+UXBJPO3jj2VhAw== 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);