From: Mark Brown <broonie@kernel.org>
To: Stefan Agner <stefan@agner.ch>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap: add regmap_debugfs_exit as devres action
Date: Fri, 19 May 2017 17:46:16 +0100 [thread overview]
Message-ID: <20170519164616.a4c3ojkfid6oqnts@sirena.org.uk> (raw)
In-Reply-To: <20170515080827.22905-1-stefan@agner.ch>
[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]
On Mon, May 15, 2017 at 01:08:27AM -0700, Stefan Agner wrote:
> Instead of manually cleanup regmap_debugfs_exit, use devres action
> to do the cleanup. This also works for external users of
> regmap_attach_dev.
Why? It's also not clear to me that this will work if something creates
a regmap, frees it and then creates another one on the same device
without a reprobe. There have been a few devices that did that as part
of enumeration of the device, they created a simple regmap to read ID
registers then replaced it with a more complete description of the
actual device they found.
> This fixes warnings when reloading certain drivers making use of
> regmap_debugfs_exit:
> imx7d-pinctrl 30330000.iomuxc: Failed to create debugfs directory
How? (and this should be in the changelog.)
> @@ -1215,7 +1216,6 @@ void regmap_exit(struct regmap *map)
> struct regmap_async *async;
>
> regcache_exit(map);
> - regmap_debugfs_exit(map);
> regmap_range_exit(map);
> if (map->bus && map->bus->free_context)
> map->bus->free_context(map->bus_context);
This isn't obviously correct, it reorders the cleanup such that the
debugfs entries will only get removed when the device is removed which
means that the debugfs entries will be hanging around after the regmap
has been deinstantiated. In the common case where it too was allocated
as a managed resource that'll work out but if for some reason it wasn't
allocated as as managed resource then the debugfs entry will be
dealocated after the regmap.
We should also be doing the debugfs cleanup before the regcache cleanup
but that's a separate and preexisting bug.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2017-05-19 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 8:08 Stefan Agner
2017-05-19 16:46 ` Mark Brown [this message]
2017-05-20 6:36 ` Stefan Agner
2017-05-22 11:33 ` 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=20170519164616.a4c3ojkfid6oqnts@sirena.org.uk \
--to=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan@agner.ch \
/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®