mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] regmap: debugfs: Free debugfs_name buffer after usage
Date: Fri, 7 Jan 2022 13:27:16 +0000	[thread overview]
Message-ID: <Ydg/tOqbeT1Cg6sh@sirena.org.uk> (raw)
In-Reply-To: <CAOMZO5DQEEHYJHv08nC=uYXbFtL9VTAatNAB8V5D_JHiQ0q=3A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

On Thu, Jan 06, 2022 at 11:22:32PM -0300, Fabio Estevam wrote:
> On Thu, Jan 6, 2022 at 6:13 PM Fabio Estevam <festevam@gmail.com> wrote:

> > > Before we try to reinitialise debugfs for the new name seems like the
> > > obvious place.

> > I am afraid I am not enough familiar with regmap to fix this problem.

> > If you could please submit a patch, I will be glad to test it.

> I tried this change:
> @@ -581,6 +581,8 @@ void regmap_debugfs_init(struct regmap *map)
>         if (map->dev)
>                 devname = dev_name(map->dev);
> 
> +       regmap_debugfs_exit(map);
> +

I would have expected this to be prior to the call to _init() rather
than actually in the call to _init() but OTOH this should work fine so
meh.

> It does avoid the 'already present' error and I see that
> /sys/kernel/debug/regmap/20e0000.pinctrl-gpr
> is present, but /sys/kernel/debug/regmap/20e0000.pinctrl-gpr is not.
> Not sure if this is the desired behavior.

Yes, that's what we're looking for (assuming the second of those names
should be the dummy name) - that means that the old debugfs file is not
hanging around and so won't be stuck there pointing at a deallocated
regmap if the regmap gets freed for some reason.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-01-07 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 17:50 Fabio Estevam
2022-01-06 18:33 ` Mark Brown
2022-01-06 19:27   ` Fabio Estevam
2022-01-06 20:05     ` Mark Brown
2022-01-06 21:13       ` Fabio Estevam
2022-01-07  2:22         ` Fabio Estevam
2022-01-07 13:27           ` Mark Brown [this message]
2022-01-07 14:48             ` Fabio Estevam
2022-01-07 14:52               ` 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=Ydg/tOqbeT1Cg6sh@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.schiffer@ew.tq-group.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

all inboxes | Powered by JetHome®