From patchwork Tue Jul 31 16:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 143193 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5521176ljj; Tue, 31 Jul 2018 09:13:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe+xYUz+w1+bN7ikJSdJ7px/2YYe0+cb2d2kStGCW4XqFHIVIMTBW/G4gnlaAUeIM5ZbLHs X-Received: by 2002:a63:81c3:: with SMTP id t186-v6mr21389802pgd.413.1533053631442; Tue, 31 Jul 2018 09:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533053631; cv=none; d=google.com; s=arc-20160816; b=FXPcV7xrTn463uAY0tuwnPejZNXOD9NjZSCLH/m7EbOGtEd8r/KAJfoCDmNTZt51Jv 1/VXWj0V/X/fyt5e4LOCGXncnxH3XZew/Zi08FIzJMCdUZEHx5YD5n/vmFloST4OpdA0 BPimQh8lDqOoRKF63VpOqGswzqw8EvWRJCBplCpdl7MDPlnGe9BoyE0ISKc+18wECjqX +X0dkkZMfdLiiIUH8HcZF05CMVbtAhP/kaZrJHrRInTFBmORZ3hDJ6R0hs/ZEU0wzYkC aDUcXfLNwa7ZqF9M/xxSKKWAbDsZUoCI5R/0P0SWmphZUpGvqcI7trvI2pyBt9HDZG/Z yPMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8971kHMqB1BIZ6HWSxsZArUibT9JYkQi4qgQVLSJefc=; b=i1Ecqm4HbhtgfOPd85ghxP4GV9eYKXPpv0UAnBeE/Dx7SAj7hbnTnVTAAuc7IeA/s/ MmZuDROEu7xu9A/EJyQKimnwUJ5O7KXIZE5mhGjYjDcYMBmbpDkLDeX/6I3csJXgeA/B f78etHFn5+amRJn1973KH8hHyRLSUXIFKnmcxfMje/L28D+pnJLMkFWjWa7FpubxEPO6 EQo6ZGmxqeam4pZKorIHhU0heOyf7i999XCatkzsdrYsH200bP4jsW3dXtLDLvhOETx3 MbD4iXCtLJN/fTSCAW19AoVWF1PDw04J68XoSW5ozdZDfnkLAbEtqt8NbEUhnBAYasGe hQ4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Iq5d2rnL; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 s2-v6si12597283pgc.447.2018.07.31.09.13.51; Tue, 31 Jul 2018 09:13:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Iq5d2rnL; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbeGaRyv (ORCPT + 13 others); Tue, 31 Jul 2018 13:54:51 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35947 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727569AbeGaRyu (ORCPT ); Tue, 31 Jul 2018 13:54:50 -0400 Received: by mail-wr1-f66.google.com with SMTP id h9-v6so17283768wro.3 for ; Tue, 31 Jul 2018 09:13:48 -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; bh=MstRtlbSy22PdLRbN/kTddePgmsV5+WAQ27NH2SPrJw=; b=Iq5d2rnL9lMSwZ3/x3Y+anfMCcAWqd5FbNsH+M7x3YUq+PIWFp6fm7Gtt3sSOLZnJK w+2UbbNc7mYNqmV/QolqNbuUwqYAviFMEwq6C2uwRpKhQ0a17biFifBrvIChVYesRAz0 e+6oM2sdEKaLU6EAcpTl22PnPXJWy5zki/6zg= 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; bh=MstRtlbSy22PdLRbN/kTddePgmsV5+WAQ27NH2SPrJw=; b=iDV8MeF679fOohBJi0TqBp8BgEv8LGU+loRbM0hve14zQxi3oLC1BLc0YJ4uSt2Wa1 +K1HCEFnDsw48nGVp1DjZOcwzdrLdiQjF0AJfQ2/zQyZN/wdtd3tWrK5Kjo57/ltI0xx oT2H/e0SzA9evPT0rpUYFbwutouICuj2y9ymC5cbhoCrlsXTMa6OCcxYXWgHC9OgnUh8 Bfh6YCra8B01nwL1/yeeQ3GF2QxAFYJHEChqyLlLN91LQgvACqBvDJFQi1AdsCO2/0Mj OQQNEU/MzNqCNXD6rnc2AlABB8wAsrz/0G229S3MJSWAibVt5MlA7451g5FICJEJQzx1 9JsQ== X-Gm-Message-State: AOUpUlHBdyuq2soLqP+uVeccvTMfgUY0SnZAA6jKL7/YOn5G3uTco24c ZHTFvFRrx8JdBHVV2tFyWm3Zcg== X-Received: by 2002:adf:fe8f:: with SMTP id l15-v6mr22111546wrr.165.1533053628052; Tue, 31 Jul 2018 09:13:48 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id t186-v6sm3643457wmf.14.2018.07.31.09.13.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 09:13:47 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org, gregkh@linuxfoundation.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, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, abailon@baylibre.com, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v7 3/8] interconnect: Add debugfs support Date: Tue, 31 Jul 2018 19:13:35 +0300 Message-Id: <20180731161340.13000-4-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180731161340.13000-1-georgi.djakov@linaro.org> References: <20180731161340.13000-1-georgi.djakov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a functionality to provide information about the current constraints per each node and provider. Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 78 +++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 1de4997bc75a..9fef180cf77e 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -6,6 +6,7 @@ * Author: Georgi Djakov */ +#include #include #include #include @@ -16,10 +17,12 @@ #include #include #include +#include static DEFINE_IDR(icc_idr); static LIST_HEAD(icc_provider_list); static DEFINE_MUTEX(icc_lock); +static struct dentry *icc_debugfs_dir; /** * struct icc_req - constraints that are attached to each node @@ -48,6 +51,62 @@ struct icc_path { struct icc_req reqs[]; }; +#ifdef CONFIG_DEBUG_FS + +static void icc_summary_show_one(struct seq_file *s, struct icc_node *n) +{ + if (!n) + return; + + seq_printf(s, "%-30s %12d %12d\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_provider_list, 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 %12d %12d\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, +}; +#endif + static struct icc_node *node_find(const int id) { return idr_find(&icc_idr, id); @@ -564,6 +623,25 @@ int icc_provider_del(struct icc_provider *provider) } EXPORT_SYMBOL_GPL(icc_provider_del); +static int __init icc_init(void) +{ +#ifdef CONFIG_DEBUG_FS + icc_debugfs_dir = debugfs_create_dir("interconnect", NULL); + debugfs_create_file("interconnect_summary", 0444, + icc_debugfs_dir, NULL, &icc_summary_fops); +#endif + return 0; +} + +static void __exit icc_exit(void) +{ +#ifdef CONFIG_DEBUG_FS + debugfs_remove_recursive(icc_debugfs_dir); +#endif +} +module_init(icc_init); +module_exit(icc_exit); + MODULE_AUTHOR("Georgi Djakov X-Patchwork-Id: 143198 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5521334ljj; Tue, 31 Jul 2018 09:13:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpev7Mp7k29maWZmDKPUoegEOSgXWTE6SKrjhzl30ktalr21/qM0uoFpv8BmhmrD3nTsTo7z X-Received: by 2002:a65:6258:: with SMTP id q24-v6mr21043806pgv.131.1533053638825; Tue, 31 Jul 2018 09:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533053638; cv=none; d=google.com; s=arc-20160816; b=TOnuYt9iGPcijPjP0DbfqKjF/0UjKP4f61OsbixjbTgFcGGID3u8CzZ/MB4M9+kjNF waRVl/FVpyNKjQ8aogBawEP0++7tB6Vgc7UZM3XjG5IMQZFU3EzPTUVSJ+IvXFXHzsUv wZ9MneRdU5R0ojejAPKL7t0h9By3IWlyYAp+C86HoEwTkaCiMHa0cHUNso+/3VJRg31O 9X++pc+cNWUebhK9Qbsh8IO85eVT8bU7nEYXXJV7EI5pWltE142Aw0CFNIdq570JAIWh IhVC4JhD+gpagnQH7J/Msb5Qp4G0YMIG2CiSrxPeAuDfzMxdIou+yDtaFOoLh0A7urvg OL1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wC7Vu0kLTSANY7jWKnEAj2rQeqap3T9DWNNDWQHDQl8=; b=fcfzqgTBZT1l3w8tay0+0y9r//Xt06oEFJoZxyhS1MGEA0gKOucmLYrpi/VzGlxfl4 IYZViGtYmRDWf2+ljEVADnQxdgbeaTWPMUx1DZo7jXavLficzsm1l1C02BN9gWM9X0zo 7Rp0fe86RvbJvXelgsC37smZXUN+CCTJWBQxORDTNL/+4SK7BThBxBGDC8qj+XNXngd0 +Jz6mDa7O/6aCWFkoc9Qh9JX8HUnzxCob1Ew/8FNf0iyfKXZbCdp5QDW0tDz9H3WWAL0 DCApvmMKhdWmVyTaNHc04GVavUsXtW2v2j8Lvcv8Dd7MvDUhquPBsC2kG/7IQVKult3D Af8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CLJ3iguW; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 o123-v6si15772581pfg.5.2018.07.31.09.13.58; Tue, 31 Jul 2018 09:13:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CLJ3iguW; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732556AbeGaRy6 (ORCPT + 13 others); Tue, 31 Jul 2018 13:54:58 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37032 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732536AbeGaRy6 (ORCPT ); Tue, 31 Jul 2018 13:54:58 -0400 Received: by mail-wr1-f68.google.com with SMTP id q10-v6so17268717wrd.4 for ; Tue, 31 Jul 2018 09:13: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:in-reply-to:references; bh=K+OuSyfn41q9eG33WrMKqO2krbdG9pjKcv2baAyctME=; b=CLJ3iguWWFbaIUz2Z+1ims8YJIQtFqvuzc422GhxGQFk5fLddWtgOhxu8JxcgYVfry zNdoN0nXPT7UvGtxDcQ1ix1B7vbXkZJ3SqZdYdBYI/wXG/LEh34DAnLKjh9e700iXPtA FEJvpp3421DE2X7npcXQLW+VItS4FPRnExR5E= 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; bh=K+OuSyfn41q9eG33WrMKqO2krbdG9pjKcv2baAyctME=; b=cwUbzKkbKSYZGPcl6ceeWfdCTn+Nb1eeRYsfHdCakv5b+3ByqIyWdt0wXyyDBf8cXE /6VEqIrYxB0aC25CkYiKqLUPkhkm6Tu/p2PnSJRHBBoqwMO5r3oJ16odAKXyTkmwehZd sm+P0s7q5B5YSrxFaZx2SUUnB0wtnAVB816OF/gcBoxe6QSDoxrCYdFVmVgVQkLcGXDb v06XHQ0y/LE+B8lGELQUvOQk08sQtcvPlgkSh46ohKM2FFGjAFr7a81U2gVgMaza5j5+ GHKi+wiAwV6+f9SY4UTT98/WsWKIQUEeqFjt8unmpX05IdDyPxuGBe82zfNwr0A3YA/u /uQg== X-Gm-Message-State: AOUpUlHUAXMgUGhZgcuYvFty2ibcrI2jG7zjbQ0y5XFY5MS8NNhtJQnv RBiGMBgTzSrApZTYhazsaciUVg== X-Received: by 2002:adf:8325:: with SMTP id 34-v6mr21291114wrd.67.1533053635362; Tue, 31 Jul 2018 09:13:55 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id t186-v6sm3643457wmf.14.2018.07.31.09.13.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 09:13:54 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org, gregkh@linuxfoundation.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, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, abailon@baylibre.com, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v7 7/8] dt-bindings: Introduce interconnect consumers bindings Date: Tue, 31 Jul 2018 19:13:39 +0300 Message-Id: <20180731161340.13000-8-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180731161340.13000-1-georgi.djakov@linaro.org> References: <20180731161340.13000-1-georgi.djakov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add documentation for the interconnect consumer bindings, that will allow to link a device node (consumer) to its interconnect controller hardware. Tha aim is to enable drivers to request a framework API to configure an interconnect path by providing their struct device pointer and a name. Signed-off-by: Georgi Djakov --- .../bindings/interconnect/interconnect.txt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/interconnect/interconnect.txt b/Documentation/devicetree/bindings/interconnect/interconnect.txt index 6e2b2971b094..5cb7d3c8d44d 100644 --- a/Documentation/devicetree/bindings/interconnect/interconnect.txt +++ b/Documentation/devicetree/bindings/interconnect/interconnect.txt @@ -31,3 +31,30 @@ Example: 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 + specifiers. + +Example: + + sdhci@7864000 { + ... + interconnects = <&pnoc MASTER_SDCC_1 &bimc SLAVE_EBI_CH0>; + interconnect-names = "ddr"; + };