linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	patches@opensource.cirrus.com
Subject: Re: [PATCH v2] regulator: wm8994: Don't use devres for enable GPIOs
Date: Thu, 22 Nov 2018 16:47:20 +0100	[thread overview]
Message-ID: <CACRpkdb9KStEkMigDX2kA4Q-tr6DuuWqqTuF6jXZK67Zp+DxmA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdb3HSQ_h1+9RvBUEDRDSCih7bv7kcf+=cc3-c0Hn6A0bg@mail.gmail.com>

On Thu, Nov 22, 2018 at 3:19 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Nov 21, 2018 at 11:13 AM Charles Keepax
> <ckeepax@opensource.cirrus.com> wrote:
>
> > The regulator core takes over managing the lifetime of the enable GPIO
> > once the regulator is registered. As such we shouldn't register the
> > enable GPIO using devm, or it will be freed twice.
> >
> > Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Oh no this is not the right solution I think.

All drivers passing a descriptor (config->ena_gpiod) do their
own refcounting, including some using a function that has no
non-devm* counterpart.

It is better if we teach the core to not gpiod_put() those.

The other patch series I am floating to get rid of the legacy
GPIO handling from the core will do away with all the
legacy GPIO handling anyway, so let me introduce a bit
of ugliness (that can be backported) and then delete that
ugliness with an updated series v8 of my legacy GPIO
cleanup.

Sorry for the inconvenience.

Will send a patch soon.

Yours,
Linus Walleij

  reply	other threads:[~2018-11-22 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181121101410epcas3p27a2a577c3b5a0608f7808ff733fab9d1@epcas3p2.samsung.com>
2018-11-21 10:13 ` [PATCH v2] regulator: wm8994: Don't use devres for enable GPIOs Charles Keepax
2018-11-21 10:42   ` Marek Szyprowski
2018-11-21 10:59     ` Charles Keepax
2018-11-22 14:20     ` Linus Walleij
2018-11-22 14:19   ` Linus Walleij
2018-11-22 15:47     ` Linus Walleij [this message]
2018-11-22 17:21       ` Charles Keepax

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=CACRpkdb9KStEkMigDX2kA4Q-tr6DuuWqqTuF6jXZK67Zp+DxmA@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=patches@opensource.cirrus.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).