All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] opp: Expose of-node's name in debugfs
Date: Thu, 10 Feb 2022 21:38:14 +0800	[thread overview]
Message-ID: <20220210133814.GB334894@leoy-ThinkPad-X240s> (raw)
In-Reply-To: <6d4ebbbe09f97c9f97834c293a70f6a8a4d36709.1644487134.git.viresh.kumar@linaro.org>

Hi Viresh,

On Thu, Feb 10, 2022 at 03:29:26PM +0530, Viresh Kumar wrote:
> It is difficult to find which OPPs are active at the moment, specially
> if there are multiple OPPs with same frequency available in the device
> tree (controlled by supported hardware feature).
> 
> Expose name of the DT node to find out the exact OPP.
> 
> While at it, also expose level field.
> 
> Reported-by: Leo Yan <leo.yan@linaro.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks a lot for patch.  I verified it:

Tested-by: Leo Yan <leo.yan@linaro.org>

> ---
>  drivers/opp/debugfs.c | 5 +++++
>  drivers/opp/opp.h     | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c
> index 596c185b5dda..b5f2f9f39392 100644
> --- a/drivers/opp/debugfs.c
> +++ b/drivers/opp/debugfs.c
> @@ -10,6 +10,7 @@
>  #include <linux/debugfs.h>
>  #include <linux/device.h>
>  #include <linux/err.h>
> +#include <linux/of.h>
>  #include <linux/init.h>
>  #include <linux/limits.h>
>  #include <linux/slab.h>
> @@ -131,9 +132,13 @@ void opp_debug_create_one(struct dev_pm_opp *opp, struct opp_table *opp_table)
>  	debugfs_create_bool("suspend", S_IRUGO, d, &opp->suspend);
>  	debugfs_create_u32("performance_state", S_IRUGO, d, &opp->pstate);
>  	debugfs_create_ulong("rate_hz", S_IRUGO, d, &opp->rate);
> +	debugfs_create_u32("level", S_IRUGO, d, &opp->level);
>  	debugfs_create_ulong("clock_latency_ns", S_IRUGO, d,
>  			     &opp->clock_latency_ns);
>  
> +	opp->of_name = of_node_full_name(opp->np);
> +	debugfs_create_str("of_name", S_IRUGO, d, (char **)&opp->of_name);
> +
>  	opp_debug_create_supplies(opp, opp_table, d);
>  	opp_debug_create_bw(opp, opp_table, d);
>  
> diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h
> index 407c3bfe51d9..45e3a55239a1 100644
> --- a/drivers/opp/opp.h
> +++ b/drivers/opp/opp.h
> @@ -96,6 +96,7 @@ struct dev_pm_opp {
>  
>  #ifdef CONFIG_DEBUG_FS
>  	struct dentry *dentry;
> +	const char *of_name;
>  #endif
>  };
>  
> -- 
> 2.31.1.272.g89b43f80a514
> 

      reply	other threads:[~2022-02-10 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10  9:59 [PATCH] opp: Expose of-node's name in debugfs Viresh Kumar
2022-02-10 13:38 ` Leo Yan [this message]

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=20220210133814.GB334894@leoy-ThinkPad-X240s \
    --to=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.