From: Vinod Koul <vkoul@kernel.org>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
dan.j.williams@intel.com, geert@linux-m68k.org
Subject: Re: [PATCH v4 1/2] dmaengine: Add basic debugfs support
Date: Tue, 3 Mar 2020 09:57:25 +0530 [thread overview]
Message-ID: <20200303042725.GM4148@vkoul-mobl> (raw)
In-Reply-To: <be7d4df5-121b-0eec-b68c-fa3b5cffc8c9@ti.com>
On 02-03-20, 13:53, Peter Ujfalusi wrote:
>
>
> On 02/03/2020 12.28, Peter Ujfalusi wrote:
> > Hi Vinod,
> >
> > On 02/03/2020 9.11, Vinod Koul wrote:
> >>> diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
> >>> index e8a320c9e57c..72cd7fe33638 100644
> >>> --- a/drivers/dma/dmaengine.h
> >>> +++ b/drivers/dma/dmaengine.h
> >>> @@ -182,4 +182,10 @@ dmaengine_desc_callback_valid(struct dmaengine_desc_callback *cb)
> >>> struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
> >>> struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
> >>>
> >>> +#ifdef CONFIG_DEBUG_FS
> >>> +#include <linux/debugfs.h>
> >>> +
> >>> +struct dentry *dmaengine_get_debugfs_root(void);
> >>
> >> this needs to have an else defined with NULL return so that we dont
> >> force users to wrap the code under CONFIG_DEBUG_FS..
> >
> > Drivers would anyways should have their debugfs related code wrapped
> > within ifdef. There is no point of having the code complied when it can
> > not be used (no debugfs support).
> >
> > But I can add the else case if we really want to:
> >
> > #ifdef CONFIG_DEBUG_FS
> > #include <linux/debugfs.h>
> >
> > struct dentry *dmaengine_get_debugfs_root(void);
> >
> > #else
> > struct dentry;
> > static inline struct dentry *dmaengine_get_debugfs_root(void)
> > {
> > return NULL;
> > }
> > #endif /* CONFIG_DEBUG_FS */
>
> It might be even better if the core creates directories for the dma
> controllers in dma_async_device_register() and removes the whole
> directory in dma_async_device_unregister()
hmmm, i think makes sense and dentry can be part of dma_device
>
> Then drivers can get their per device root via:
> #ifdef CONFIG_DEBUG_FS
> static inline struct dentry *
> dmaengine_get_debugfs_root(struct dma_device *dma_dev) {
> return dma_dev->dbg_dev_root;
> }
right!
> #else
> struct dentry;
> static inline struct dentry *
> dmaengine_get_debugfs_root(struct dma_device *dma_dev)
> {
> return NULL;
> }
> #endif /* CONFIG_DEBUG_FS */
--
~Vinod
next prev parent reply other threads:[~2020-03-03 4:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 13:07 [PATCH v4 0/2] dmaengine: Initial debugfs support Peter Ujfalusi
2020-02-28 13:07 ` [PATCH v4 1/2] dmaengine: Add basic " Peter Ujfalusi
2020-03-02 7:11 ` Vinod Koul
2020-03-02 10:28 ` Peter Ujfalusi
2020-03-02 11:53 ` Peter Ujfalusi
2020-03-03 4:27 ` Vinod Koul [this message]
2020-02-28 13:07 ` [PATCH v4 2/2] dmaengine: ti: k3-udma: Implement custom dbg_summary_show for debugfs Peter Ujfalusi
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=20200303042725.GM4148@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.ujfalusi@ti.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;
as well as URLs for NNTP newsgroup(s).