From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Daniel Scally" <djrscally@gmail.com>,
"Heikki Krogerus" <heikki.krogerus@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>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.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, brgl@kernel.org
Subject: Re: [PATCH v3 1/2] software node: return -ENOTCONN when referenced swnode is not registered yet
Date: Tue, 7 Apr 2026 10:04:18 +0300 [thread overview]
Message-ID: <adSscliuE_kHopnC@kekkonen.localdomain> (raw)
In-Reply-To: <20260403-swnode-unreg-retcode-v3-1-7886092b28b4@oss.qualcomm.com>
Hi Bartosz,
Thanks for the update.
On Fri, Apr 03, 2026 at 03:51:50PM +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
> -ENOTCONN to indicate the software node is "not connected".
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
> drivers/base/swnode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index 51320837f3a9f1bf4f65aa161d9b941affc74936..61e73417aee89feb855b0f429e112ca0af78a003 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -554,7 +554,7 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode,
> return -EINVAL;
>
> if (!refnode)
> - return -ENOENT;
> + return -ENOTCONN;
This needs to be documented for fwnode_property_get_reference_args() as
well.
In V4L2 we do
<URL:https://lore.kernel.org/linux-media/20260313091122.GA333526@killaraus.ideasonboard.com/T/#t>
so the caller just returns the error code but maybe that's not generic
enough.
>
> if (nargs_prop) {
> error = fwnode_property_read_u32(refnode, nargs_prop, &nargs_prop_val);
>
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2026-04-07 7:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 13:51 [PATCH v3 0/2] driver core: make references to unregistered software nodes a special case Bartosz Golaszewski
2026-04-03 13:51 ` [PATCH v3 1/2] software node: return -ENOTCONN when referenced swnode is not registered yet Bartosz Golaszewski
2026-04-06 19:31 ` Andy Shevchenko
2026-04-07 7:04 ` Sakari Ailus [this message]
2026-04-03 13:51 ` [PATCH v3 2/2] gpio: swnode: defer probe on references to unregistered software nodes Bartosz Golaszewski
2026-04-06 19:29 ` 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=adSscliuE_kHopnC@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--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 \
/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