From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: Axel Lin <axel.lin@ingics.com>, "Girdwood, Liam" <lrg@ti.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] regulator-core: update all enable GPIO state in _enable/disable
Date: Mon, 14 Jan 2013 02:50:25 +0000 [thread overview]
Message-ID: <20130114025025.GA30179@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998F69E12A43@DQHE02.ent.ti.com>
On Mon, Jan 14, 2013 at 02:44:08AM +0000, Kim, Milo wrote:
> > So, clearly that's going to be the behaviour at the system level but
> > the
> > consumers aren't going to know that. If the consumer supports some of
> > the supplies being enabled and disabled separately then it will rely on
> > the regulator core reference counting to keep the supply enabled if
> > there are other reasons to do so. This is how things would work if
> > both
> > supplies came from the same regulator so I'd expect us to preserve the
> > same behaviour.
> OK, the consumer just cares about the regulator(s) which is(are) obtained.
> However it doesn't show exact state of regulator in case that enable GPIOs are
> shared.
It would do if my suggestion that we use a shared state for the GPIO
were implemented!
> (6) CB tries to get the state of LDO3 before disabling it,
> regulator_is_enabled() returns 1, but real state is 0.
> if(!regulator_is_enabled(rdev))
> regulator_disable(rdev);
> Therefore CB never disables LDO3, use_count is always 1.
> This patch solves this unmatched situation.
This is just a buggy consumer - the consumer would also break if there
were a single regulator shared by two consumers. There's almost no case
outside of bootstrapping where it makes sense to check if the regulator
is enabled for anything other than diagnostics.
> Regulator APIs may show unmatched value, but it can be handled in each consumer
> driver *separately*.
> Therefore, we should not update 'ena_gpio_state' of other regulators.
> This patch should be ignored.
> Is that correct?
No, we need to reference count over all the regualtors sharing the
enable line. Otherwise we won't pay attention to references held by
anything other than the regulator currently being enabled or disabled.
next prev parent reply other threads:[~2013-01-14 2:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 9:46 [PATCH 2/3] regulator-core: update all enable GPIO state in _enable/disable Kim, Milo
2013-01-13 22:42 ` Mark Brown
2013-01-13 23:35 ` Kim, Milo
2013-01-14 1:42 ` Mark Brown
2013-01-14 2:44 ` Kim, Milo
2013-01-14 2:50 ` Mark Brown [this message]
2013-01-21 23:59 ` Kim, Milo
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=20130114025025.GA30179@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=Milo.Kim@ti.com \
--cc=axel.lin@ingics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
/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;
as well as URLs for NNTP newsgroup(s).