From patchwork Fri Dec 7 15:29:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 153163 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp629718ljp; Fri, 7 Dec 2018 07:29:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOGVrApCkcuJqnzh/ZrfmDb3PhV9T/YEvlFrxv8ot7oEmIai4G7jHJxriNAV8KnwCA04U5 X-Received: by 2002:a63:68c4:: with SMTP id d187mr2301207pgc.11.1544196569910; Fri, 07 Dec 2018 07:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544196569; cv=none; d=google.com; s=arc-20160816; b=Z6jH1lzQYV6mVVvFNRJiFZuG+mkK3QlhgkeWqewyE+8SCv0z69n7r13v/eiu+fh9oJ w4PBb7TVNPKyqAax3mWf36M2TkVzc0xqpkgM45YAZw+e5oEdeuvy7DAblEm4G1I4iM3o GUi5xXeGmmrt3CAee/fOXI/ir6FI4y8nhmyTJWKr5RnGpCNzqNVs38WbaZH3qMQjMzJk jJRtoIpPMb1BGcVM90fAoFZxsqDC212HvVmRWn/yl9oZx/z8g+bMsmVK6outd+CmuJJv 9gocf5Lfy6MAkOOCv/q+u6WBsH/2zzg4C1+LFw37rq+WvVozGpCFcWSSpk3tDCqH40XB QqVA== 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=RDj6MDHY8LfhaKzwZwR+xk+j8tl7N19Jf8vqoRp4O4Y=; b=hdHm7SuAvdpW8t5t4/RZOQlwSCfWRUbKW4CAmF2RTalUPmDdMx5R4yne3vbvXkVsNW Uo4DteKgo4/9Da4Qkc2GO0SxsDeIGiYhuub0Cxqr0mhTXVRX4VpetF0qWqAt70irKMl8 EdeSiKAsMX5uvihg+RdyXp+nnp1A84i7QRzP7kpW1ZiOGU821fNLTRCfvNekYX/iGsyj xyzNACZwglrsIWJC29N0bW9SKy/jWud2opr4UOfi6O0sChr4iEZi6PEu6ucY58Gf00ux vlZ5Ik9rqnv0cZPK+QKLwNxOHMjkQnjVAaB1qz4NPLS93dSrafQaiVFY0yUIVn+gYP7l CR2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TBlhCU+Q; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id r6si3188610pli.248.2018.12.07.07.29.29; Fri, 07 Dec 2018 07:29:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=TBlhCU+Q; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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 S1726077AbeLGP32 (ORCPT + 11 others); Fri, 7 Dec 2018 10:29:28 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34964 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726158AbeLGP31 (ORCPT ); Fri, 7 Dec 2018 10:29:27 -0500 Received: by mail-wm1-f68.google.com with SMTP id c126so4923743wmh.0 for ; Fri, 07 Dec 2018 07:29:26 -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=RDj6MDHY8LfhaKzwZwR+xk+j8tl7N19Jf8vqoRp4O4Y=; b=TBlhCU+QpJs0e62CNtOmnH8EuDCbTs5nwf9+D/bWuRXOAo9kzw8a6XMrBcX3dGGkI1 5bTG0DSuPBGdxzgapoNVR7u1wFv3JcMiVdao6XFt2l92C1P7zeZRKzbGbZv5WIoWmBy/ EE/l87tIzCR1sK/TAmjJlY/lZCHjfAnc4RElo= 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=RDj6MDHY8LfhaKzwZwR+xk+j8tl7N19Jf8vqoRp4O4Y=; b=YeFMX4ZgUJgMfIw1DCapOJ+fMbJMfoCgN428qW1OzSv3+otvpi7xvutmoULYPm+imF 5p8EofI5voV8agYshptNiACa61qGqE/u2pmpKM2B6BLNQc0PWpx+ewLTJ8ID+CWT5Ljl UDj1M3lB3N/Wf1DTvbbIWl+SYvkJVw8UxV+zbT4Wbh6jsxoVmZzf2vKRoQ8B09gTXyk/ G1jj9wIs+w5R4wvorRzoPunlCVLlgu9QADvnWw3aFcIxPCb01wRI59LCcypg/z6n3vBr qYKlWhc4WJr3Mbic4ZsO5N1I9CX3keU0px5uhmnBqPfB7B2dGcDwEQJYDkI87qTAQADh K+Qg== X-Gm-Message-State: AA+aEWY46zyo1ESD2J7tiedwtsLmojERXSsUdTBEpGASldGXQdvfpXaH 9ilB/dekWhrxRVA9DMWNRpFnaQ== X-Received: by 2002:a1c:d08b:: with SMTP id h133mr2656724wmg.8.1544196565420; Fri, 07 Dec 2018 07:29:25 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y145sm2728721wmd.30.2018.12.07.07.29.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Dec 2018 07:29:24 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org, linux-pm@vger.kernel.org Cc: 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, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, abailon@baylibre.com, maxime.ripard@bootlin.com, arnd@arndb.de, thierry.reding@gmail.com, ksitaraman@nvidia.com, sanjayc@nvidia.com, 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, georgi.djakov@linaro.org Subject: [PATCH v11 2/8] dt-bindings: Introduce interconnect binding Date: Fri, 7 Dec 2018 17:29:11 +0200 Message-Id: <20181207152917.4862-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181207152917.4862-1-georgi.djakov@linaro.org> References: <20181207152917.4862-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 This binding is intended to represent the relations between the interconnect controllers (providers) and consumer device nodes. It will allow creating links between consumers and interconnect paths (exposed by interconnect providers). Reviewed-by: Evan Green Signed-off-by: Georgi Djakov --- .../bindings/interconnect/interconnect.txt | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/interconnect.txt diff --git a/Documentation/devicetree/bindings/interconnect/interconnect.txt b/Documentation/devicetree/bindings/interconnect/interconnect.txt new file mode 100644 index 000000000000..6775c07e1574 --- /dev/null +++ b/Documentation/devicetree/bindings/interconnect/interconnect.txt @@ -0,0 +1,60 @@ +Interconnect Provider Device Tree Bindings +========================================= + +The purpose of this document is to define a common set of generic interconnect +providers/consumers properties. + + += interconnect providers = + +The interconnect provider binding is intended to represent the interconnect +controllers in the system. Each provider registers a set of interconnect +nodes, which expose the interconnect related capabilities of the interconnect +to consumer drivers. These capabilities can be throughput, latency, priority +etc. The consumer drivers set constraints on interconnect path (or endpoints) +depending on the use case. Interconnect providers can also be interconnect +consumers, such as in the case where two network-on-chip fabrics interface +directly. + +Required properties: +- compatible : contains the interconnect provider compatible string +- #interconnect-cells : number of cells in a interconnect specifier needed to + encode the interconnect node id + +Example: + + snoc: interconnect@580000 { + compatible = "qcom,msm8916-snoc"; + #interconnect-cells = <1>; + reg = <0x580000 0x14000>; + clock-names = "bus_clk", "bus_a_clk"; + clocks = <&rpmcc RPM_SMD_SNOC_CLK>, + <&rpmcc RPM_SMD_SNOC_A_CLK>; + }; + + += interconnect consumers = + +The interconnect consumers are device nodes which dynamically express their +bandwidth requirements along interconnect paths they are connected to. There +can be multiple interconnect providers on a SoC and the consumer may consume +multiple paths from different providers depending on use case and the +components it has to interact with. + +Required properties: +interconnects : Pairs of phandles and interconnect provider specifier to denote + the edge source and destination ports of the interconnect path. + +Optional properties: +interconnect-names : List of interconnect path name strings sorted in the same + order as the interconnects property. Consumers drivers will use + interconnect-names to match interconnect paths with interconnect + specifier pairs. + +Example: + + sdhci@7864000 { + ... + interconnects = <&pnoc MASTER_SDCC_1 &bimc SLAVE_EBI_CH0>; + interconnect-names = "sdhc-ddr"; + }; From patchwork Fri Dec 7 15:29:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 153164 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp629793ljp; Fri, 7 Dec 2018 07:29:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/UE1RVsoQsxq2niDoRtAM4DrnDBmUxY5aJPuzED/srLvRTPEp6ugsT7xL8gn+0lIL8S6zfM X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr2608969plp.180.1544196574629; Fri, 07 Dec 2018 07:29:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544196574; cv=none; d=google.com; s=arc-20160816; b=pwx3YOriVKxttYI3QBIM7e0liR7aza5uyerDdja9N4FYyzuR/lvBQakdX7GdyrYelU +C3UxNGvStPmVNza1SFwNBCA9CBMQsFpt/bpeAMQPznxBgRSP3wQeUeMsKyDLPWAjZcP mfjUuBs1PwzFhI1sW+u0ur6X8njFhZnPYcYoAiToqe3XOlRYpexqaNmlQMbvgQ2thCv3 BKEvR+n6sYKr9kQCPckRmGgnD/vNYJ8BzGZdGqxxDSjDvSM8CEg3UfXbTvDoKbcl4LPe VdTcJhfycb31TIGZ1386XkWkBXF9fV+MwgWzRryCf0cE9eoOzURSG/ygsDcvR68c1Dfh sEHA== 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=C9WXnWBuhV6priAyhwQEr5olumbkswiCcUF+DIQmTjY=; b=XWH1feTGH9m0JbvwVcdGwqvYIXcPdom/SlPXuwuDOblEHXHJXolyYBw61Hq6ctgXfV ReZtD/DMttK4Zju0zwb9O6BC5zs6Det4ndpH89/m/+zwo3cDY4GVeWwrmaKxdpC31fGY Ie4tBiWu0cEFCFvyN9zvH+rtrCWBIm0TuFSfxKAqkGtrGkxrP7shvztJ6GBtrul2Lmgi mQ4GUR1f7vCrZu8N5wp+V61BKS8luOb0IzMcsKBTJ9JjE5y1AT/KllEplEznJVZgjtQk mD9DYILJZWy8/6mDhUR95YmafW7sfK/KVio1IQJhNVHmf0mBkl2D4YWz5DE6QmrM8zgg 0RhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H1/tGmfR"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 23si3363799pfk.287.2018.12.07.07.29.34; Fri, 07 Dec 2018 07:29:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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="H1/tGmfR"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 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 S1726214AbeLGP3d (ORCPT + 11 others); Fri, 7 Dec 2018 10:29:33 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36995 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbeLGP3b (ORCPT ); Fri, 7 Dec 2018 10:29:31 -0500 Received: by mail-wr1-f67.google.com with SMTP id j10so4196236wru.4 for ; Fri, 07 Dec 2018 07:29:30 -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=C9WXnWBuhV6priAyhwQEr5olumbkswiCcUF+DIQmTjY=; b=H1/tGmfRAeqQSGk4awyq0DUDJWjd0fMiXOHlLBjqcgdbr2FRG3yD4YtbkY/vr32+wW 6pkuQwZNSO1S2/iifa83ed25sbCstaxKx/T2fq5I7BrpbmDC0yduNd9b6E7gamPfoZr1 ahIKbU1dL9puIp6ZBZ2DEfooqWbpTEoXzfO44= 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=C9WXnWBuhV6priAyhwQEr5olumbkswiCcUF+DIQmTjY=; b=mqY1k8MeljwT2FWLeLkE2Z7HogXKFm3D3cpMDuCbB/sOA0eyRA5wdx9D7wkUUNtQ3s ULnJkwvpLgR3rd6d2q8nS/HGIjUrGLqlVENOEGadQSf0/M6uJ83415ZwOD7cHRqcDMMa s/cj8f6KXbtzoyAeoND+ZVWi6lkJ/U9br8MVxLyqRxYUS9wdDJ19yxiNHN83CMg6VYNV 2oFPfrkjVZfATfwGIJGk0uBIjTQj8G6VKvvf9t0kCYO1kE1tF/vnFXTUWPb4Efv2ghXK 51igqF/dysF0TBEYjN2MCGhRaVc3kVMnA6FAS74rEiyFiUfe+xGmTUuOuSVnIqDTY4HT /0mw== X-Gm-Message-State: AA+aEWZwKOjfJ4ZMt549I3NP7LG1kP9yP92B1QKUpWCBeCisry8+iuvf LaU6Gr+ey6L8rXIIYV2UnYGY/g== X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr2110332wrx.315.1544196569368; Fri, 07 Dec 2018 07:29:29 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y145sm2728721wmd.30.2018.12.07.07.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Dec 2018 07:29:28 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org, linux-pm@vger.kernel.org Cc: 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, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, abailon@baylibre.com, maxime.ripard@bootlin.com, arnd@arndb.de, thierry.reding@gmail.com, ksitaraman@nvidia.com, sanjayc@nvidia.com, 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, georgi.djakov@linaro.org Subject: [PATCH v11 4/8] interconnect: Add debugfs support Date: Fri, 7 Dec 2018 17:29:13 +0200 Message-Id: <20181207152917.4862-5-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181207152917.4862-1-georgi.djakov@linaro.org> References: <20181207152917.4862-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 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 | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index d1854dfb1bed..5a98192e92ad 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -6,6 +6,7 @@ * Author: Georgi Djakov */ +#include #include #include #include @@ -17,10 +18,12 @@ #include #include #include +#include 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 +51,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 +767,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");