From: Maksim Kiselev <bigunclemax@gmail.com>
To: linux-clk@vger.kernel.org
Cc: Maksim Kiselev <bigunclemax@gmail.com>,
Chinmoy Ghosh <chinmoyghosh2001@gmail.com>,
Mintu Patel <mintupatel89@gmail.com>,
Vimal Kumar <vimal.kumar32@gmail.com>,
Vishal Badole <badolevishal1116@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH v1] clk: Add clock consumer and connection id to clk summary
Date: Sun, 10 Sep 2023 00:47:32 +0300 [thread overview]
Message-ID: <20230909214732.4170560-1-bigunclemax@gmail.com> (raw)
Add "consumer device" and "connection id" columns to the clk summary
in order to show which user acquired and enabled a particular clock.
Co-developed-by: Chinmoy Ghosh <chinmoyghosh2001@gmail.com>
Signed-off-by: Chinmoy Ghosh <chinmoyghosh2001@gmail.com>
Co-developed-by: Mintu Patel <mintupatel89@gmail.com>
Signed-off-by: Mintu Patel <mintupatel89@gmail.com>
Co-developed-by: Vimal Kumar <vimal.kumar32@gmail.com>
Signed-off-by: Vimal Kumar <vimal.kumar32@gmail.com>
Co-developed-by: Vishal Badole <badolevishal1116@gmail.com>
Signed-off-by: Vishal Badole <badolevishal1116@gmail.com>
Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
---
drivers/clk/clk.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index c249f9791ae8..64ee44f55a6f 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3187,7 +3187,8 @@ static struct hlist_head *orphan_list[] = {
static void clk_summary_show_one(struct seq_file *s, struct clk_core *c,
int level)
{
- int phase;
+ int phase, next_line = 0;
+ struct clk *clk_user;
seq_printf(s, "%*s%-*s %7d %8d %8d %11lu %10lu ",
level * 3 + 1, "",
@@ -3205,11 +3206,25 @@ static void clk_summary_show_one(struct seq_file *s, struct clk_core *c,
seq_printf(s, " %6d", clk_core_get_scaled_duty_cycle(c, 100000));
if (c->ops->is_enabled)
- seq_printf(s, " %9c\n", clk_core_is_enabled(c) ? 'Y' : 'N');
+ seq_printf(s, " %9c", clk_core_is_enabled(c) ? 'Y' : 'N');
else if (!c->ops->enable)
- seq_printf(s, " %9c\n", 'Y');
+ seq_printf(s, " %9c", 'Y');
else
- seq_printf(s, " %9c\n", '?');
+ seq_printf(s, " %9c", '?');
+
+ hlist_for_each_entry(clk_user, &c->clks, clks_node) {
+ if (!clk_user->dev_id && !clk_user->con_id)
+ continue;
+
+ seq_printf(s, "%*s%-25s %10s\n",
+ 2 + 103 * next_line, "",
+ clk_user->dev_id, clk_user->con_id);
+
+ next_line = 1;
+ }
+
+ if (!next_line)
+ seq_puts(s, "\n");
}
static void clk_summary_show_subtree(struct seq_file *s, struct clk_core *c,
@@ -3230,9 +3245,9 @@ static int clk_summary_show(struct seq_file *s, void *data)
struct clk_core *c;
struct hlist_head **lists = s->private;
- seq_puts(s, " enable prepare protect duty hardware\n");
- seq_puts(s, " clock count count count rate accuracy phase cycle enable\n");
- seq_puts(s, "-------------------------------------------------------------------------------------------------------\n");
+ seq_puts(s, " enable prepare protect duty hardware consumer connection\n");
+ seq_puts(s, " clock count count count rate accuracy phase cycle enable device id\n");
+ seq_puts(s, "----------------------------------------------------------------------------------------------------------------------------------------------\n");
clk_prepare_lock();
--
2.39.2
reply other threads:[~2023-09-09 21:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230909214732.4170560-1-bigunclemax@gmail.com \
--to=bigunclemax@gmail.com \
--cc=badolevishal1116@gmail.com \
--cc=chinmoyghosh2001@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mintupatel89@gmail.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=vimal.kumar32@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox