Article View: linux.kernel.netdev
Article #18715[PATCH v3 14/31] driver core: Report deferred probes through sysfs drivers_probe
From: Leon Romanovsky
Date: Wed, 18 Nov 2026 19:26
Date: Wed, 18 Nov 2026 19:26
84 lines
11189 bytes
11189 bytes
From: Leon Romanovsky <leonro@nvidia.com>
commit b8c5cec23d5c ("Driver core: udev triggered device-<>driver
binding") introduced the concept of "Systems who want to control the
driver binding with udev" can use the drivers_probe sysfs to trigger a
driver bind based on the kernel's match list.
If attaching the driver is deferred before its probe callback runs,
userspace sees EINVAL and cannot tell it should try again, maybe after
loading other drivers.
Map that deferral to EAGAIN and add missed documentation for the
drivers_probe sysfs. A deferral requested by the probe callback itself
is still not reported.
Fixes: b8c5cec23d5c ("Driver core: udev triggered device-<>driver binding")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
Documentation/ABI/testing/sysfs-bus-drivers-probe | 14 ++++++++++++++
MAINTAINERS | 1 +
drivers/base/bus.c | 9 +++++++--
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/Documentation/ABI/testing/sysfs-bus-drivers-probe b/Documentation/ABI/testing/sysfs-bus-drivers-probe
new file mode 100644
index 0000000000000..ed8828e55d6bf
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-drivers-probe
@@ -0,0 +1,14 @@
+What: /sys/bus/.../drivers_probe
+Date: February 2007
+Contact: driver-core@lists.linux.dev
+Description:
+ (WO) Writing a device name requests driver attachment on this
+ bus, even when drivers_autoprobe is disabled. A successful
+ write does not guarantee that a driver bound. The driver link
+ can appear before probe completes; a bind uevent signals
+ successful binding.
+
+ EAGAIN means attachment was deferred before the driver's probe
+ callback, for example while a supplier or the device itself
+ is not ready. ENODEV means the device was not found. Other
+ attachment errors return EINVAL.
diff --git a/MAINTAINERS b/MAINTAINERS
index 93abbb315065d..b726344362b41 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8149,6 +8149,7 @@ M: Johan Hovold <johan@kernel.org>
L: driver-core@lists.linux.dev
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
+F: Documentation/ABI/testing/sysfs-bus-drivers-probe
F: Documentation/core-api/kobject.rst
F: Documentation/driver-api/driver-model/
F: drivers/base/
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 396097fdb3162..ecff32c3704b5 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -310,13 +310,18 @@ static ssize_t drivers_probe_store(const struct bus_type *bus,
const char *buf, size_t count)
{
struct device *dev;
- int err = -EINVAL;
+ int err;
dev = bus_find_device_by_name(bus, NULL, buf);
if (!dev)
return -ENODEV;
- if (bus_rescan_devices_helper(dev, NULL) == 0)
+ err = bus_rescan_devices_helper(dev, NULL);
+ if (!err)
err = count;
+ else if (err == -EPROBE_DEFER)
+ err = -EAGAIN;
+ else
+ err = -EINVAL;
put_device(dev);
return err;
}
--
2.56.1
Technical Details
Message-ID:
<20261118-device-trust-core-v3-14-d655875c4bfb@nvidia.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366386-linux-kernel-netdev=dewy.ruReferences:
<20261118-device-trust-core-v3-0-d655875c4bfb@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366386-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH v3 14/31] driver core: Report deferred probes through sysfs drivers_probe Date: Wed, 18 Nov 2026 21:26:44 +0200 Organization: Usenet Network Message-ID: <20261118-device-trust-core-v3-14-d655875c4bfb@nvidia.com> References: <20261118-device-trust-core-v3-0-d655875c4bfb@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2681812"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:KdbdyVKyGL3rQ+7bONQsaUqu4K8= sha256:NqsRclrCebtfOHRLSgnp+DYPaW5xi2pgE+2NgW6Wovw= sha1:PgL1nXa888bs62OMJ9cDRQLsJd8= sha256:k4B6tTCawiHh/bx9+KGyhLFBPdgB9QxWAMVZ8yIVEbA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1E2731153A5; Wed, 18 Nov 2026 22:34:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Status: No, score=-2.301 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZaEaODMJL4cX; Wed, 18 Nov 2026 22:34:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-366386-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 6D97C11536C; Wed, 18 Nov 2026 22:34:30 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 4B24C141F28; Wed, 18 Nov 2026 19:30:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795030090; b=MssTC8SnM38FCQYCv5LrB8K7qfHkjDpQWFYRiB7tOLQMkiZ/CM65oONs2/kz/cFJFigP TwrJJkFCRN5UJoy9B2yiHesuElDyf4ncCBde1n3lNiFDMwyljPLV11DLshq8QH09KP6fC vzOAmwYvNVEEfPyjGCQ8qzlDIYrPGRQFOHs2KiEj7fi1Tv6dO+j2p4ZJG9F99QJ/Xgqc4 ttIGf1BNWNDzuuhn3jgf4NOAPTHezL7O8YWGiSWDgAYaW+rQzIMC30NTqEegLhgNvmWt/ xplqdn1WwvSuYBpBDVP1qrCI0yUtlCQXmcW7Sf9SCJAIBC2AT/A6Z3BfTISZfoyt4aw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795030090; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Type:X-Mailer: Content-Transfer-Encoding; bh=AI23EedCHOkVt2bUFVxVq0Tw4jV6qHaXsCMKfKtBCb8=; b=41dnqZ0/lfgrbSnwFyMhQcMIdnOnRE0NAFvw890C5yhl7ckUHN53lRrgZtkEkVNGTH53 JgwywpCGGfC9fdSw8rn8rjgIY79aUbjpij6V8JGIf9rw9LId0S1PEG1GEdWfJGCxIwdAl +mO/hzf/0MEC0CCGTqagLp/+JRfSqbjqjjsTbdKUniW5N5nArXRDb7D1YYzy+e0DQVQ5l ypxU/g4b0LayXPZjWjaFXmU/AW8ajp+KTuM5BNkQfaDvBrB4ZXDCE5mXiqdjOCQwxCiHV 4BuBpkhGSJ1I8GyLn87ZrZ/Ny7rrLZreZ49A4EGS4mmWCTnczU8CCTG5sGJwyrorb4g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bO3NjK55; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA47F60A5BCB; Wed, 18 Nov 2026 19:28:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bO3NjK55 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795030090; b=w3NA+cUGbcVB3xOVkdhvlqD0fHOjAF8I89o/dZIqXrvBD8rEN7By+gOnxxaWdjCAGviJ TxeecqA/QpujB8RUz2KqXxn8Q7m+i4IYRgM94aTpPz5Xo4RNLVl2K5zg52O9aAoOaq8TQ 3UrRf6I6SsA89srGt+QaYButSjx7KnX+E3lcyP1Df8efmhGHgwXgh5hOTH+8VTa/V9zu5 Ym747gX07PHoYesmHwu7735/JxCnuydpXKfYzjyN9rtOLu+aECbwkFmHvjhe70mK4QFZg wxlcd+CYh9zKfrSgNe97zKDzQT9HaUpI8w0+dal1LTp57RfZJVYje47Emhbrz6DPgbw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795030090; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type:X-Mailer: Content-Transfer-Encoding; bh=AI23EedCHOkVt2bUFVxVq0Tw4jV6qHaXsCMKfKtBCb8=; b=BhIzPldRCabPCIZrILnz6zgQ349jaWvrV8d8R/BFnlDWM/p4Q4WEz5IBaIzkqZZ5rUCP iDFXPpq+niCX2fTfVqPXPR3+qsNcD/I7Rd1nnU7708Lgt7Gj9+jG4eMS+oS4tdJdffsz+ 2cGF50eCaLsBTVfoQzkBZPnzVJNQSbO2ppvqoUUAgRoPxtuTTBM0ZIb01c5agGOPkDe0n ynjGpbW18f2+aWvS+3BnhpaSHGsVYtzXEe3mIt8ViBwxWkb3C3xX12soUbCrU3YU0bW6k IvljjIsKPSGsdWnSovcbKLf2N6Cgm/Mm9EQi8L6VjgLIx360R3du8pORMuEK9XSp3iQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bO3NjK55; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0671606DD12; Wed, 18 Nov 2026 19:28:09 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE2941F000C7; Wed, 18 Nov 2026 19:28:08 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795030089; bh=AI23EedCHOkVt2bUFVxVq0Tw4jV6qHaXsCMKfKtBCb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bO3NjK55ns1629VdRftCmyGPsBjYPnXV9gEkr7QhP0WpECrtF8MvO+YnVRWnLKSUW k2u/T6Om4T5qkH0FSnf3Qx8NzMmaqQWaZc+npQXX/lL55XMUHIO5WvPa8HTfZWdXqs j/LCriv/5ZRyf45K6cbbNSa/gw/SF9WefYSM0SQMUO0y2Zzs8GLVHFIn0L+9HwPMpx rdZA40+5IR0evh1jHt4zg4KdLd7aTY31voXbpMNHnK28RSUy61C+mAtKkcwmleyD0P YZndbAHvGDEd3meMwDosu/rVkioU/iyBqSjb0NNdIlRJ4KKG2hZWm/yNsqRWFb8So3 Mv6BN5sRIMTvA== X-Cc: linux-kernel@vger.kernel.org, driver-core@lists.linux.dev, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, iommu@lists.linux.dev, linux-coco@lists.linux.dev, Alexey Kardashevskiy <aik@amd.com>, Luiz Augusto von Dentz <luiz.von.dentz@intel.com>, Greg Kroah-Hartman <gregkh@suse.de>, linux-sound@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca> X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261118-device-trust-core-v3-0-d655875c4bfb@nvidia.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Mailer: b4 0.15-dev-18f8f