From: Bartosz Golaszewski <brgl@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>,
"Daniel Scally" <djrscally@gmail.com>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Len Brown" <lenb@kernel.org>,
linux-acpi@vger.kernel.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2 1/4] software node: return -ENXIO when referenced swnode is not registered yet
Date: Tue, 7 Apr 2026 12:57:29 +0200 [thread overview]
Message-ID: <CAMRc=MeRSKWoEn36hht4JuwrwOMpoA5g_Xju2XT9Urq3mQS2wg@mail.gmail.com> (raw)
In-Reply-To: <ac_9EV3C0I1WXQz2@google.com>
On Fri, Apr 3, 2026 at 8:07 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Fri, Apr 03, 2026 at 09:29:38AM +0200, Bartosz Golaszewski wrote:
> > On Thu, Apr 2, 2026 at 10:43 PM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Thu, Apr 02, 2026 at 04:35:34PM +0300, Andy Shevchenko wrote:
> > > > On Thu, Apr 02, 2026 at 02:54:26PM +0200, Bartosz Golaszewski wrote:
> > > > > It's possible that at the time of resolving a reference to a remote
> > > > > software node, the node we know exists is not yet registered as a full
> > > > > firmware node. We currently return -ENOENT in this case but the same
> > > > > error code is also returned in some other cases, like the reference
> > > > > property with given name not existing in the property list of the local
> > > > > software node.
> > > > >
> > > > > It makes sense to let users know that we're dealing with an unregistered
> > > > > software node so that they can defer probe - the situation is somewhat
> > > > > similar to there existing a firmware node to which no device is bound
> > > > > yet - which is valid grounds for probe deferral. To that end: use -ENXIO
> > > > > which stands for "No such device or address".
> > > >
> > > > This error code is also too generic to my taste. What about alternative(s)?
> > > > EADDRNOTAVAIL
> > > > ENOTCONN
> > > >
> > > > (The brief grep shows that the second one might suit slightly better than the
> > > > first one by existing use cases.)
> > >
> > > We are in the core of the driver core. Why not simply use -EPROBE_DEFER
> > > to which all users will resolve this error to and call it a day?
> > >
> >
> > Because -EPROBE_DEFER only makes sense in probe() context, while
> > fwnode_get_reference_args() may be called in many other situations.
>
> Exactly same argument applies to your follow-up change: gpiod_get()
> returning -EPROBE_DEFER only makes sense in probe context but it may be
> called in many other situations. Are you planning to change all places
> where gpiolib returns -EPROBE_DEFER to something else just in case it
> might be called outside of probe context?
>
I'd argue that gpiod_get() should really be limited to being called at
probe() time but I see your point.
> -EPROBE_DEFER should have been called -ENOTREADY from the beginning and
> then we would not have this argument. Or, even better, we should have
> used -EAGAIN. But it is just a name, semantics does not really change.
> We want to signal that something is not ready and the operation needs be
> repeated. Currently we contorting ourselves by using yet another error
> code that everyone will either convert to -EPORBE_DEFER or will handle
> like -EAGAIN.
>
> > I think ENOTCONN as "not connected" makes sense, though the string
>
> Why is it better? Most of users of -ENOTCONN are in networking code so
> it is somewhat unexpected to have other APIs return it.
>
> > representation says: "Transport endpoint is not connected" which
> > doesn't spell out quite the same thing.
>
> Yes, because it is really for networking/sockets handling.
>
> Thanks.
>
Andy et al: what is your take on this?
Bart
next prev parent reply other threads:[~2026-04-07 10:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 12:54 [PATCH v2 0/4] platform/x86: x86-android-tablets: use real firmware node references with intel drivers Bartosz Golaszewski
2026-04-02 12:54 ` [PATCH v2 1/4] software node: return -ENXIO when referenced swnode is not registered yet Bartosz Golaszewski
2026-04-02 13:35 ` Andy Shevchenko
2026-04-02 20:43 ` Dmitry Torokhov
2026-04-03 7:29 ` Bartosz Golaszewski
2026-04-03 18:07 ` Dmitry Torokhov
2026-04-07 10:57 ` Bartosz Golaszewski [this message]
2026-04-07 13:30 ` Bartosz Golaszewski
2026-04-07 13:59 ` Andy Shevchenko
2026-04-02 12:54 ` [PATCH v2 2/4] gpio: swnode: defer probe on references to unregistered software nodes Bartosz Golaszewski
2026-04-02 21:04 ` Dmitry Torokhov
2026-04-03 7:26 ` Bartosz Golaszewski
2026-04-03 13:44 ` Bartosz Golaszewski
2026-04-02 12:54 ` [PATCH v2 3/4] ACPI: bus: export the acpi_bus_type symbol Bartosz Golaszewski
2026-04-02 12:54 ` [PATCH v2 4/4] platform/x86: x86-android-tablets: enable fwnode matching of GPIO chips Bartosz Golaszewski
2026-04-04 18:25 ` Rafael J. Wysocki
2026-04-27 11:30 ` Bartosz Golaszewski
2026-04-02 13:23 ` [PATCH v2 0/4] platform/x86: x86-android-tablets: use real firmware node references with intel drivers Andy Shevchenko
2026-04-02 13:35 ` Bartosz Golaszewski
2026-04-02 13:47 ` Andy Shevchenko
2026-04-02 15:03 ` Bartosz Golaszewski
2026-04-02 16:05 ` Andy Shevchenko
2026-04-02 16:13 ` Bartosz Golaszewski
2026-04-02 16:18 ` Andy Shevchenko
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='CAMRc=MeRSKWoEn36hht4JuwrwOMpoA5g_Xju2XT9Urq3mQS2wg@mail.gmail.com' \
--to=brgl@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.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 read-only IMAP folder(s) and NNTP newsgroup(s).