Re: regmap: mmio: lack of runtime_pm support for debugfs

From: Brian Norris
Date: Fri Feb 04 2022 - 14:53:18 EST


On Fri, Feb 4, 2022 at 11:41 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
> On Fri, Feb 04, 2022 at 11:21:51AM -0800, Brian Norris wrote:
> > We do actually have a cache for the case I care about, but there's
> > also a debugfs file for bypassing that and...for some reason I'm
> > dealing with some diagnostic scripts that purposely toggle that. I'm
> > not sure how wise that is, but in general I like to reduce the number
> > of ways dumb user space can screw things up. I've even had to tell
> > people that recursively grepping through sysfs or debugfs is a bad
> > idea...
>
> Are you sure this extra thing that bypasses the cache isn't an out of
> tree patch? It really doesn't sound like a good idea to have that, and
> if people think they need it they probably have drivers doing something
> quite unfortunate. Or are you just looking at the upstream debugfs with
> some volatile registers?

https://git.kernel.org/linus/d3dc5430d68fb91a62d971648170b34d46ab85bc
regmap: debugfs: Allow writes to cache state settings

And it's still there:
https://elixir.bootlin.com/linux/v5.16.5/source/drivers/base/regmap/regmap-debugfs.c#L521

Again, I didn't claim the *use* of that bypass in the aforementioned
diagnostic script was a good idea...but it's at least possible. I've
already carved out more exceptions so that script doesn't do bad
things on some systems, but maybe I'll poke the authors even more, to
see if they have a good reason for using the bypass.

Brian