lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be7d4df5-121b-0eec-b68c-fa3b5cffc8c9@ti.com>
Date:   Mon, 2 Mar 2020 13:53:52 +0200
From:   Peter Ujfalusi <peter.ujfalusi@...com>
To:     Vinod Koul <vkoul@...nel.org>
CC:     <dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <dan.j.williams@...el.com>, <geert@...ux-m68k.org>
Subject: Re: [PATCH v4 1/2] dmaengine: Add basic debugfs support



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()

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;
}
#else
struct dentry;
static inline struct dentry *
dmaengine_get_debugfs_root(struct dma_device *dma_dev)
{
	return NULL;
}
#endif /* CONFIG_DEBUG_FS */

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ