From: abhinavk@codeaurora.org
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>,
Stephen Boyd <swboyd@chromium.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [Freedreno] [PATCH] drm/msm/dp: Move debugfs files into subdirectory
Date: Fri, 15 Oct 2021 16:53:48 -0700 [thread overview]
Message-ID: <f72263e0d4c118653fff8b1341dc487b@codeaurora.org> (raw)
In-Reply-To: <20211015231702.1784254-1-bjorn.andersson@linaro.org>
On 2021-10-15 16:17, Bjorn Andersson wrote:
> In the cleanup path of the MSM DP driver the DP driver's debugfs files
> are destroyed by invoking debugfs_remove_recursive() on debug->root,
> which during initialization has been set to minor->debugfs_root.
>
> To allow cleaning up the DP driver's debugfs files either each dentry
> needs to be kept track of or the files needs to be put in a
> subdirectory
> which can be removed in one go.
>
> By choosing to put the debugfs files in a subdirectory, based on the
> name of the associated connector this also solves the problem that
> these
> names would collide as support for multiple DP instances are
> introduced.
>
> One alternative solution to the problem with colliding file names would
> have been to put keep track of the individual files and put them under
> the connector's debugfs directory. But while the drm_connector has been
> allocated, its associated debugfs directory has not been created at the
> time of initialization of the dp_debug.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
I have been thinking about this problem ever since multi-DP has been
posted :)
Creating sub-directories seems right but at the moment it looks like IGT
which
uses these debugfs nodes doesnt check sub-directories:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/tools/msm_dp_compliance.c#L215
It looks for the DP debugfs nodes under /sys/kernel/debug/dri/*/
We have to fix IGT too to be able to handle multi-DP cases. I will try
to come up
with a proposal to address this.
Till then, can we go with the other solution to keep track of the
dentries?
> ---
>
> This depends on
> https://lore.kernel.org/linux-arm-msm/20211010030435.4000642-1-bjorn.andersson@linaro.org/
> reducing the connector from a double pointer.
>
> drivers/gpu/drm/msm/dp/dp_debug.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c
> b/drivers/gpu/drm/msm/dp/dp_debug.c
> index da4323556ef3..67da4c69eca1 100644
> --- a/drivers/gpu/drm/msm/dp/dp_debug.c
> +++ b/drivers/gpu/drm/msm/dp/dp_debug.c
> @@ -210,26 +210,29 @@ static const struct file_operations
> test_active_fops = {
> static int dp_debug_init(struct dp_debug *dp_debug, struct drm_minor
> *minor)
> {
> int rc = 0;
> + char path[64];
> struct dp_debug_private *debug = container_of(dp_debug,
> struct dp_debug_private, dp_debug);
>
> - debugfs_create_file("dp_debug", 0444, minor->debugfs_root,
> + snprintf(path, sizeof(path), "msm_dp-%s", debug->connector->name);
> +
> + debug->root = debugfs_create_dir(path, minor->debugfs_root);
> +
> + debugfs_create_file("dp_debug", 0444, debug->root,
> debug, &dp_debug_fops);
>
> debugfs_create_file("msm_dp_test_active", 0444,
> - minor->debugfs_root,
> + debug->root,
> debug, &test_active_fops);
>
> debugfs_create_file("msm_dp_test_data", 0444,
> - minor->debugfs_root,
> + debug->root,
> debug, &dp_test_data_fops);
>
> debugfs_create_file("msm_dp_test_type", 0444,
> - minor->debugfs_root,
> + debug->root,
> debug, &dp_test_type_fops);
>
> - debug->root = minor->debugfs_root;
> -
> return rc;
> }
next prev parent reply other threads:[~2021-10-15 23:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 23:17 [PATCH] drm/msm/dp: Move debugfs files into subdirectory Bjorn Andersson
2021-10-15 23:53 ` abhinavk [this message]
2021-10-17 16:42 ` [Freedreno] " Bjorn Andersson
2021-10-18 18:07 ` abhinavk
2021-10-18 18:36 ` Bjorn Andersson
2021-12-08 23:54 ` abhinavk
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=f72263e0d4c118653fff8b1341dc487b@codeaurora.org \
--to=abhinavk@codeaurora.org \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox