lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regmap: do not call regmap_debugfs_init() from regmap_attach_dev()
On Mon, Jul 26, 2021 at 02:01:51PM +0200, Matthias Schiffer wrote:
> On Mon, 2021-07-26 at 12:47 +0100, Mark Brown wrote:

> > The use case for regmap_attach_dev() is that there was no device when
> > the regmap was initially instantiated due to it running very early, we
> > want to attach the device when we figure out what it is which includes
> > setting up the debugfs stuff. Whatever is managing to call this with
> > the same device as has already been set is clearly not that use case.

> I'm not talking about a case where regmap_attach_dev() is called when
> there is already a device attached; as far as I can tell such a thing
> does not happen in current kernel code.

So in that case how are we managing to create a debugfs file with the
same name given (which was the problem you were reporting) that the
device name is embedded in the name of the debugfs file?

> Please have a look at the commit in the Fixes: tag. The duplicate
> regmap_debugfs_init() happens even when no device was passed in
> __regmap_init(), so the regmap_attach_dev() is the first time a device
> it attached.

That's not what your patch says it's fixing, your patch says it's
fixing an attempt to recreate the same directory as we had originally
(we should probably clean up the one with no device but that's not what
your commit does). I think what you need to look at here is that we
store map->debugfs_name and don't overwrite it when the device is
supplied.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-07-26 14:12    [W:2.009 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site