From patchwork Wed Jan 16 16:10:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 155722 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp835795jaa; Wed, 16 Jan 2019 08:11:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Y5MF/im/13OPxhQH75LUTzPJf+7hFi/SejotjyVGJ3KoRo8d8m2EgPbuaHB6jD2mtibF0 X-Received: by 2002:a63:f515:: with SMTP id w21mr9474102pgh.220.1547655082708; Wed, 16 Jan 2019 08:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547655082; cv=none; d=google.com; s=arc-20160816; b=G08k+j2damLV8XfLprq1HrXwaRyO0Yk35XCWGwBJGNAK6ApyEVmF1AlMjR0bT2Pk/W ZMciHYnX6laPwKSRgGQtHdPCCgYdP7oa7bLe2em9ojS3Vdoroer+LiQl+V/RT4LHdNy6 zQTvwZGtpylv3rtnTlgrewntDQrkTyUrQ0m0a2rbJIzxKEKAFha2ietOLz6VsH5jQUCi kTw/t5w8xA+pHiHtryJ26VLTXcweM5nr3L2CX6rVZ6GFgtfa2GLAuhDNxx6Fvn1vxX5l HzCOnH9DlznnEqdTra1yArMXZLW7Dcjp417P+5GquVabsDi5+BPDfK3XoDrad1PZvRrv fHLA== 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=Dv+pY3mbEG8oP8SFilyrA7S//jhmEn3muBmKLb21XKY=; b=dKC2dB/sbsJP86MPQxGWc/f2kHtqX9gjNF75w3lahGqEuOHnKc8Vnu8sfMHRh9Sa7R yu3hP5SJou2AtNQIL6o/oEm6p8j4aIEtT9J7F5N7J5nmw24Sj25PBi0XvUNhVYhoTxRn PbjSh2emHPvtDqB3GK1UqGJMcsKxRwBwnGvupHpPOtgcZHxCgxAzc8vHwKCkfTrhionR KfJEZtK91Z60B5xjW4iTqs/c4NPz3zH7HwA/uLZcbxQkvE2k5U2icHkCBE3Z5lBRawS0 Tu/krbFGMuMpNamWh8fs+KSjU5yzzAJopKCWtDXOgG3HoLWa+vNy92XQW0KxDyVijHng YvSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V10Xf+8K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id s8si3259005pgm.508.2019.01.16.08.11.22; Wed, 16 Jan 2019 08:11:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V10Xf+8K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2405227AbfAPQLV (ORCPT + 29 others); Wed, 16 Jan 2019 11:11:21 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55590 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405202AbfAPQLR (ORCPT ); Wed, 16 Jan 2019 11:11:17 -0500 Received: by mail-wm1-f66.google.com with SMTP id y139so2553938wmc.5 for ; Wed, 16 Jan 2019 08:11:16 -0800 (PST) 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=Dv+pY3mbEG8oP8SFilyrA7S//jhmEn3muBmKLb21XKY=; b=V10Xf+8KYu71ENB3vcyeUopKffaiT51jsBZls2odIK7kw5Y8dIv56eEAIIzjrybAG9 vOgyOzqCglBya7XcA5m26ckA+YRM8MIN8UR9CLyKXGpXBh5uk+7p6kHk9YnaSWxWkhgL lJQBJasKTLzQilSE9BGczPMWfLMcj/TDvjvnM= 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=Dv+pY3mbEG8oP8SFilyrA7S//jhmEn3muBmKLb21XKY=; b=QdPKII8sruX+xE+s6SRX0KO35k9cfx/AdlVFY7fP1p5+eBHAUcZJW+Evn6oD1FSCvg JFmRjRo4lQrowzZAv+SIt5LoIRK3Two7d5QjucFQwJDCL4Gl1K0p/fXx5IKRBQBolStK CylzArWtj6cnS01RB4R601k/FmgAYYH06iUHK66F25C7I+oorXE7UEXn8ow+ZqJMXYZb s6xgEZJ1/7MUDDYRx0UqumMgNlERxA8fOl2LV2uyrK3Be7+klnW4sNQm3JbHG66+gt1D Iyy5/BexbqPiwDKv4Oa5LINepSG6Iy4hzUMDocu/gNsn2iyhpzsR1+XOiCBRcsLFyCSo 3h1A== X-Gm-Message-State: AJcUuke7wHnLC6d4TaBvK3/Vkvu9sn4KnZim/yZ/KUlVF00/p0iHTnFM /yAiymx7EOVg/g6zk2nnfHloNg== X-Received: by 2002:a1c:a8d2:: with SMTP id r201mr7887736wme.81.1547655076200; Wed, 16 Jan 2019 08:11:16 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a17sm78193407wrs.58.2019.01.16.08.11.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 08:11:15 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: andy.gross@linaro.org, olof@lixom.net, arnd@arndb.de, rjw@rjwysocki.net, robh+dt@kernel.org, mturquette@baylibre.com, khilman@baylibre.com, vincent.guittot@linaro.org, skannan@codeaurora.org, bjorn.andersson@linaro.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, dianders@chromium.org, abailon@baylibre.com, maxime.ripard@bootlin.com, thierry.reding@gmail.com, ksitaraman@nvidia.com, sanjayc@nvidia.com, henryc.chen@mediatek.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, georgi.djakov@linaro.org Subject: [PATCH v13 4/8] interconnect: Add debugfs support Date: Wed, 16 Jan 2019 18:10:59 +0200 Message-Id: <20190116161103.6937-5-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190116161103.6937-1-georgi.djakov@linaro.org> References: <20190116161103.6937-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a functionality to provide information about the current constraints per each node and provider. Reviewed-by: Evan Green Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index a8c2bd35197f..8091d998549a 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -6,6 +6,7 @@ * Author: Georgi Djakov */ +#include #include #include #include @@ -21,6 +22,7 @@ static DEFINE_IDR(icc_idr); static LIST_HEAD(icc_providers); static DEFINE_MUTEX(icc_lock); +static struct dentry *icc_debugfs_dir; /** * struct icc_req - constraints that are attached to each node @@ -48,6 +50,59 @@ struct icc_path { struct icc_req reqs[]; }; +static void icc_summary_show_one(struct seq_file *s, struct icc_node *n) +{ + if (!n) + return; + + seq_printf(s, "%-30s %12u %12u\n", + n->name, n->avg_bw, n->peak_bw); +} + +static int icc_summary_show(struct seq_file *s, void *data) +{ + struct icc_provider *provider; + + seq_puts(s, " node avg peak\n"); + seq_puts(s, "--------------------------------------------------------\n"); + + mutex_lock(&icc_lock); + + list_for_each_entry(provider, &icc_providers, provider_list) { + struct icc_node *n; + + list_for_each_entry(n, &provider->nodes, node_list) { + struct icc_req *r; + + icc_summary_show_one(s, n); + hlist_for_each_entry(r, &n->req_list, req_node) { + if (!r->dev) + continue; + + seq_printf(s, " %-26s %12u %12u\n", + dev_name(r->dev), r->avg_bw, + r->peak_bw); + } + } + } + + mutex_unlock(&icc_lock); + + return 0; +} + +static int icc_summary_open(struct inode *inode, struct file *file) +{ + return single_open(file, icc_summary_show, inode->i_private); +} + +static const struct file_operations icc_summary_fops = { + .open = icc_summary_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static struct icc_node *node_find(const int id) { return idr_find(&icc_idr, id); @@ -711,6 +766,21 @@ int icc_provider_del(struct icc_provider *provider) } EXPORT_SYMBOL_GPL(icc_provider_del); +static int __init icc_init(void) +{ + icc_debugfs_dir = debugfs_create_dir("interconnect", NULL); + debugfs_create_file("interconnect_summary", 0444, + icc_debugfs_dir, NULL, &icc_summary_fops); + return 0; +} + +static void __exit icc_exit(void) +{ + debugfs_remove_recursive(icc_debugfs_dir); +} +module_init(icc_init); +module_exit(icc_exit); + MODULE_AUTHOR("Georgi Djakov "); MODULE_DESCRIPTION("Interconnect Driver Core"); MODULE_LICENSE("GPL v2"); From patchwork Wed Jan 16 16:11:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 155723 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp835894jaa; Wed, 16 Jan 2019 08:11:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN4nlWH0jyTgKxd6nwcdk+tG+VI8skZqgWKfGlm2a13ccTem8lFTY4iyuys1Jiq5EeUO8PSf X-Received: by 2002:a65:5c4b:: with SMTP id v11mr9509155pgr.333.1547655087406; Wed, 16 Jan 2019 08:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547655087; cv=none; d=google.com; s=arc-20160816; b=oGu+hfmYWCjHfqs2QJjBy25XBcWfkwqQaQzD5h6l9xMnG+n1M8wSXUzj9OggInHTkv a6lFZI0UlaS0Q6XyWTvNGsiIa4XfAdBocAtKjYQFZFzI9MKpfrVO97PsbFCyWeNHC5ss HaroOES+3W/6gZGpKFFASQXIIw15X3nZ5C3PxxjeftX/jK9+GUWpe5wUrbYqx+H4i6AC MuQY52DHoN4Dn2HrE4P/hfi8hHYTjndw5sFQxbTHdSW61QLa3o+i4CPmC9NDITSbIjeb BfFq8BzSkE+uCsA13IbrG4eBf9NM8U0ec/P6WR7kSxnrkAWDkZPZGRs6Kxx9GODhd4g6 NveQ== 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=Jinzyf9/O+SMx8INgN4EUNWLAGDQnyj+5fdQ+uj/Fb0=; b=k5fxNTwYHn/iRmVwKCY5+USPHG91rirvry7GJjAh/Hzesc01KmUB+W1xOnBPu0ZjfT NTiYoTSQmanPd4YChhKyD5+7mL64C9CDvj+/GXxNs63zMcK3UzfrhMCs+kUS1FqHKa2J kyDzlBMMZD9w/YDXOy5BO0jfoXEFAv08kP/fmA6ALgD2Ca3b89Q/742xNlUulrFdGfkw PVp89Lt/SBXNyWw+M6Jn1VyT8dhyoIl3LtuSpqS31hgYFPgHOSvA0/3VWAvn5wTgEbVg 3TD37frMVnFJ4P5TAFJVylW4LJ6WUCsMyz6RfL8QpGGIWyTp1aAShulR8PHYavXw7k+u 4wwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AjTAT1Bs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id s8si3259005pgm.508.2019.01.16.08.11.26; Wed, 16 Jan 2019 08:11:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AjTAT1Bs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2405254AbfAPQL0 (ORCPT + 29 others); Wed, 16 Jan 2019 11:11:26 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54334 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405228AbfAPQLW (ORCPT ); Wed, 16 Jan 2019 11:11:22 -0500 Received: by mail-wm1-f67.google.com with SMTP id a62so2580821wmh.4 for ; Wed, 16 Jan 2019 08:11:21 -0800 (PST) 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=Jinzyf9/O+SMx8INgN4EUNWLAGDQnyj+5fdQ+uj/Fb0=; b=AjTAT1BsYmaPC+ck8CpYqZVy5QMSxxLiU4/+Z3z4MhkagvUjAWUYVoiPq6eBH9qYA0 nJkwADZpLT/dC7d07kuFthh50AqOSYg5bkOhNKGBQomqrjgDtIR6U4DPlBRryL5PQIT1 BRsyQ1aD/Ows3h/6DAo2X7AraFlNcN6eq9N6E= 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=Jinzyf9/O+SMx8INgN4EUNWLAGDQnyj+5fdQ+uj/Fb0=; b=d5FBVy/XSCUPkPs61rNjZD4VDGeLTGB8IU6KFNxow0+lo3SdzmfyKOWXaEUUFfX9/Z X1jkiBIZE6o8+7jdnQPKk1pF9qc1AOLQi6E0DyKDHWUOTUSYIkOiVxrlX0uB3R09c91X ZB8+6IwB0lcTg8irOchFChjxWsqAQm5T80TH3P2qAWnxkaF1s6z1PCM6+eCaJwPn/LXw wTcqvC+TgAvZZkkwMerhuHeuVdU+fzGO/6Q7HNsiz6Xfdfc0pdei3XrnLdWb4El012Ol 9N8kW92EDGzrzL0Yw2gBW3Uywm5cU0MZIPeR0J2Vop7PcmLvqzzhoXfwSxe552650vei c2uQ== X-Gm-Message-State: AJcUukencqyM6pjLRtr5CYi17yKOxI7PasObq7GeqhBWXwn5XUygbwMP C2aQqn3NTyRg7UutCTVIcTPOBw== X-Received: by 2002:a1c:20cb:: with SMTP id g194mr7947410wmg.77.1547655080868; Wed, 16 Jan 2019 08:11:20 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a17sm78193407wrs.58.2019.01.16.08.11.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 08:11:19 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: andy.gross@linaro.org, olof@lixom.net, arnd@arndb.de, rjw@rjwysocki.net, robh+dt@kernel.org, mturquette@baylibre.com, khilman@baylibre.com, vincent.guittot@linaro.org, skannan@codeaurora.org, bjorn.andersson@linaro.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, dianders@chromium.org, abailon@baylibre.com, maxime.ripard@bootlin.com, thierry.reding@gmail.com, ksitaraman@nvidia.com, sanjayc@nvidia.com, henryc.chen@mediatek.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, georgi.djakov@linaro.org Subject: [PATCH v13 6/8] arm64: dts: sdm845: Add interconnect provider DT nodes Date: Wed, 16 Jan 2019 18:11:01 +0200 Message-Id: <20190116161103.6937-7-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190116161103.6937-1-georgi.djakov@linaro.org> References: <20190116161103.6937-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Dai Add RSC (Resource State Coordinator) provider dictating network-on-chip interconnect bus performance found on SDM845-based platforms. Signed-off-by: David Dai Signed-off-by: Georgi Djakov --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index c27cbd3bcb0a..5179cb94c95b 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -1602,6 +1603,11 @@ compatible = "qcom,sdm845-rpmh-clk"; #clock-cells = <1>; }; + + rsc_hlos: interconnect { + compatible = "qcom,sdm845-rsc-hlos"; + #interconnect-cells = <1>; + }; }; intc: interrupt-controller@17a00000 {