Re: [PATCH] regulator: fix use_count bug

From: Mark Brown
Date: Sun Oct 13 2013 - 14:13:12 EST


On Sun, Oct 13, 2013 at 06:01:11PM +0300, Nikita Kiryanov wrote:
> During regulator registration the regulator framework checks that the
> regulator is:

Please try to make your commit messages briefer and more focused on
describing the problem. A good way to do this is usually to start from
the problem and then explain it - what you're doing here is providing a
lot of background material without telling the reader why which makes it
hard to find out what the commit is supposed to do.

> invocations. The state of regX is not the result of a regulator_enable
> call, so use_count increments should not be propogated on the supply
> dependency chain. Instead, if there's a need for regX to be enabled on
> boot, the boot_on flag should be used for all the regulators on the
> supply chain.

No, that's not what this is trying to do. It's trying to bring the
logical state of the system in sync with the physical state of the
system (as you'll see from the commit introducing it). I suspect what
needs to happen to maintain the functionality is that the code needs to
directly call the ops (and walk the tree manually) to do the enables so
that the reference counts aren't disturbed.

boot_on definitely shouldn't be related to this and probably shouldn't
need all the parent regulators to be manually forced on either.

Attachment: signature.asc
Description: Digital signature