linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	David Lechner <david@lechnology.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap: do not call regmap_debugfs_init() from regmap_attach_dev()
Date: Mon, 26 Jul 2021 14:01:51 +0200	[thread overview]
Message-ID: <7b54590fddf167744fa2574d8815130608f8e063.camel@ew.tq-group.com> (raw)
In-Reply-To: <20210726114751.GE4670@sirena.org.uk>

On Mon, 2021-07-26 at 12:47 +0100, Mark Brown wrote:
> * PGP Signed by an unknown key
> 
> On Mon, Jul 26, 2021 at 09:36:27AM +0200, Matthias Schiffer wrote:
> > regmap_debugfs_init() should never be called twice for the same regmap,
> > as it initializes various fields of the regmap struct, including list
> > heads and mutices. A visible symptom are messages like:
> > 
> >     debugfs: Directory 'dummy-iomuxc-gpr@20e4000' with parent 'regmap'
> >     already present!
> > 
> > This happened whenever regmap_attach_dev() was called for an existing
> > regmap. Remove the call from regmap_attach_dev() and change
> > __regmap_init() so that regmap_debugfs_init() is called exactly once.
> 
> 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.
> 
> 

Hi Mark,

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.

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.


  reply	other threads:[~2021-07-26 12:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26  7:36 [PATCH] regmap: do not call regmap_debugfs_init() from regmap_attach_dev() Matthias Schiffer
2021-07-26 11:47 ` Mark Brown
2021-07-26 12:01   ` Matthias Schiffer [this message]
2021-07-26 12:11     ` Mark Brown
2021-07-26 12:18       ` Matthias Schiffer
2021-07-26 18:48         ` Mark Brown
2021-07-27 12:24           ` (EXT) " Matthias Schiffer
2021-07-27 17:08             ` Mark Brown
2021-07-28  9:13               ` Matthias Schiffer
2021-07-26 12:00 ` Mark Brown

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=7b54590fddf167744fa2574d8815130608f8e063.camel@ew.tq-group.com \
    --to=matthias.schiffer@ew.tq-group.com \
    --cc=broonie@kernel.org \
    --cc=david@lechnology.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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 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).