LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Mark Brown <broonie@kernel.org>
Cc: milo.kim@ti.com, Axel Lin <axel.lin@ingics.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Olof Johansson <olof@lixom.net>,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
	Paul Stewart <pstew@chromium.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: core: Fix enable GPIO reference counting
Date: Wed, 4 Mar 2015 09:13:52 -0800	[thread overview]
Message-ID: <CAD=FV=XSPnpr6SC+JuLSzr_RTDoKfDoZ_x6kqeyGuG=8wfKxJA@mail.gmail.com> (raw)
In-Reply-To: <20150304112712.GI21293@sirena.org.uk>

Mark,

On Wed, Mar 4, 2015 at 3:27 AM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Mar 03, 2015 at 03:21:21PM -0800, Doug Anderson wrote:
>
>> It looks as if "ena_gpio_state" is not quite what I thought it was and
>> I think is not actually consistent in the regulator framework itself.
>> In _regulator_do_enable() and _regulator_do_disable() is clear that
>> ena_gpio_state is 1 when an "rdev" is enabled and 0 when the "rdev" is
>> disabled.  That was my assumption.  It's also clear in
>> _regulator_is_enabled().
>
>> ...but then I looked in regulator_register().  There you can see that
>> ena_gpio_state could be set to 1 if you've got an active low GPIO that
>> is disabled at boot.  That totally throws my logic for a loop.  Also
>> with my patch the reference counting will be all messed up for active
>> high / boot on regulators.  :(
>
> Isn't that just a bug in the registration code?  I'd not be entirely
> surprised if that were the case.

Yes, I'm pretty sure that's the case too and that's what I've assumed
in V2 of the patch that I sent up yesterday.  In my testing is caused
no problems, but of course my testing of my previous version also
showed no problems on my particular boards until I found the right
place to put printouts to show that the internal state was a bit
confused...

-Doug

      reply	other threads:[~2015-03-04 17:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 19:41 Doug Anderson
2015-02-27 20:08 ` Greg KH
2015-02-27 21:01 ` Javier Martinez Canillas
2015-03-02 18:57   ` Mark Brown
2015-03-02 20:21     ` Javier Martinez Canillas
2015-03-03 14:24       ` Mark Brown
2015-03-02 18:47 ` Mark Brown
2015-03-02 21:13   ` Doug Anderson
2015-03-03 14:23     ` Mark Brown
2015-03-03 23:21       ` Doug Anderson
2015-03-04 11:27         ` Mark Brown
2015-03-04 17:13           ` Doug Anderson [this message]

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='CAD=FV=XSPnpr6SC+JuLSzr_RTDoKfDoZ_x6kqeyGuG=8wfKxJA@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=javier.martinez@collabora.co.uk \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=olof@lixom.net \
    --cc=pstew@chromium.org \
    --cc=stable@vger.kernel.org \
    --subject='Re: [PATCH] regulator: core: Fix enable GPIO reference counting' \
    /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

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).