All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: zhang.chunyan@linaro.org, Doug Anderson <dianders@chromium.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	ckeepax@opensource.cirrus.com,
	lkml <linux-kernel@vger.kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH 3/3] regulator: core: make regulator_register() EPROBE_DEFER aware
Date: Wed, 18 Sep 2019 08:53:40 -0700	[thread overview]
Message-ID: <CAKdAkRSneYYjcVe--P=m037aA1DaD+efbEcRGGKVk1hDeEw70A@mail.gmail.com> (raw)
In-Reply-To: <20190918081807.yl4lkjgosq5bhow3@pengutronix.de>

On Wed, Sep 18, 2019 at 1:18 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
>
> On 19-09-17 17:57, Dmitry Torokhov wrote:
> > On Tue, Sep 17, 2019 at 4:42 PM Marco Felsch <m.felsch@pengutronix.de> wrote:
> > >
> > > Sometimes it can happen that the regulator_of_get_init_data() can't
> > > retrieve the config due to a not probed device the regulator depends on.
> > > Fix that by checking the return value of of_parse_cb() and return
> > > EPROBE_DEFER in such cases.
> >
> > Treating EPROBE_DEFER in a special way is usually wrong.
> > regulator_of_get_init_data() may fail for multiple reasons (no memory,
> > invalid DT, etc, etc). All of them should abort instantiating
> > regulator.
>
> Those errors are handled but the behaviour of this funciton is to return
> NULL in such errors which is fine for the caller of this function. I
> only want to handle EPROBE_DEFER special..

And I am saying it is wrong to handle only EPROBE_DEFER.
regulator_of_get_init_data() should always return ERR_PTR()-encoded
error code when parsing callback returns error, so that regulator core
does not mistakenly believe that there is no configuration/init data
when in fact there is, but we failed to handle it properly.

IOW I'm advocating for extending you patch so that it reads:

+               ret = desc->of_parse_cb(child, desc, config);
+               if (ret) {
+                       of_node_put(child);
+                       return ERR_PTR(ret);
+               }

Thanks.

-- 
Dmitry

  reply	other threads:[~2019-09-18 15:53 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 15:40 [PATCH 0/3] Regulator core fixes Marco Felsch
2019-09-17 15:40 ` [PATCH 1/3] regulator: core: fix boot-on regulators use_count usage Marco Felsch
2019-09-23 18:02   ` Doug Anderson
2019-09-23 18:14     ` Mark Brown
2019-09-23 18:36       ` Doug Anderson
2019-09-23 18:49         ` Mark Brown
2019-09-23 22:40           ` Doug Anderson
2019-09-24 18:27             ` Mark Brown
2019-09-26 19:44               ` Doug Anderson
2019-09-27  8:47                 ` Marco Felsch
2019-10-01 19:57                   ` Doug Anderson
2019-10-04  6:34                     ` Matti Vaittinen
2019-10-04 11:32                       ` Mark Brown
2019-10-04 12:03                         ` Vaittinen, Matti
2019-10-04 15:01                           ` Mark Brown
2019-10-07  9:34                     ` Marco Felsch
2019-10-07 18:29                       ` Mark Brown
2019-10-08  6:03                         ` Marco Felsch
2019-10-08 12:51                           ` Mark Brown
2019-10-08 14:56                             ` Marco Felsch
2019-10-08 15:42                               ` Mark Brown
2019-10-08 16:16                                 ` Marco Felsch
2019-10-08 16:23                                   ` Mark Brown
2019-10-08 20:16                                     ` Marco Felsch
2019-10-09  9:54                                       ` Mark Brown
2019-09-17 15:40 ` [PATCH 2/3] regulator: of: fix suspend-min/max-voltage parsing Marco Felsch
2019-09-17 16:02   ` Applied "regulator: of: fix suspend-min/max-voltage parsing" to the regulator tree Mark Brown
2019-09-17 15:40 ` [PATCH 3/3] regulator: core: make regulator_register() EPROBE_DEFER aware Marco Felsch
2019-09-17 16:02   ` Applied "regulator: core: make regulator_register() EPROBE_DEFER aware" to the regulator tree Mark Brown
2019-09-18  0:57   ` [PATCH 3/3] regulator: core: make regulator_register() EPROBE_DEFER aware Dmitry Torokhov
2019-09-18  8:18     ` Marco Felsch
2019-09-18 15:53       ` Dmitry Torokhov [this message]
2019-09-18 16:06         ` Marco Felsch
2019-09-18 16:08         ` Mark Brown

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='CAKdAkRSneYYjcVe--P=m037aA1DaD+efbEcRGGKVk1hDeEw70A@mail.gmail.com' \
    --to=dmitry.torokhov@gmail.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=dianders@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=zhang.chunyan@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.