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

From: Brian Norris
Date: Fri Feb 04 2022 - 15:07:08 EST


After a bit more thinking:

On Fri, Feb 4, 2022 at 11:21 AM Brian Norris <briannorris@xxxxxxxxxxxx> wrote:
> Anyway, I'll probably just go with precious_reg() as suggested above.

Unfortunately, precious_reg() wouldn't be quite safe either -- we
could do a single check for pm_runtime_active(), but we have no way of
knowing (guaranteeing) that it will remain active throughout the
remainder of the debugfs operation. For all we know, some other actor
could be *just* finishing with (and PM-suspending) our domain
immediately after the check. And we can't grab a reference, because we
don't have a callback for balancing that back out.

If I really want to solve this, I might have to go with adding a
debugfs-specific runtime_pm flag, and (to avoid too many side effects)
use that with pm_runtime_get_if_active() in regmap-debugfs.c.

Brian