Re: [PATCH v1 1/5] regmap: mmio: Don't unprepare attached clock

From: Mark Brown
Date: Mon Aug 08 2022 - 15:02:06 EST


On Mon, Aug 08, 2022 at 08:23:28PM +0200, Andy Shevchenko wrote:
> On Mon, Aug 8, 2022 at 5:52 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
> > On Mon, Aug 08, 2022 at 04:42:28PM +0200, Andy Shevchenko wrote:

> > > > I think just for symmetry so it's obvious that error handling is
> > > > happening if people want it to be.

> > > So, the only user of that API calls it explicitly. Should I rewrite a
> > > commit message somehow?

> > No. Your commit would just introduce a bug.

> There is no bug with the existing codebase after this commit. Are you
> talking about out-of-tree modules? Or maybe there is documentation
> that says that regmap clears all additionally attached resources?

If the regmap code prepared a clock it should unprepare it otherwise we
leaked a reference - the caller shouldn't have to worry what enables
are done by regmap inside the implementation (and conversely regmap is
making sure the clock is prepared and enabled when it's needed).

> Okay I may admit that Fixes tag might be wrong due to potential users
> in the past. However, in the current state of affairs either we can
> proceed with a patch, or amend documentation (if not yet done) to
> clarify this aspect of regmap MMIO. From the above I may assume that
> you would rather expect the latter to be done (if not yet).

I don't understand why you think we need any change at all here. The
only effect I can see is to make the code less robust in the case where
the user doesn't explicitly detach the clock which is not something we
document as mandatory and doesn't strike me as something where there's a
pressing need for it to be mandatory.

Attachment: signature.asc
Description: PGP signature