Article View: linux.kernel.netdev
Article #13032[PATCH v2 07/19] driver core: Report deferred probes through sysfs drivers_probe
From: Leon Romanovsky
Date: Mon, 09 Nov 2026 07:33
Date: Mon, 09 Nov 2026 07:33
82 lines
10863 bytes
10863 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.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
Documentation/ABI/testing/sysfs-bus-drivers-probe | 13 +++++++++++++
MAINTAINERS | 1 +
drivers/base/bus.c | 9 +++++++--
3 files changed, 21 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..851c65b9331ae
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-drivers-probe
@@ -0,0 +1,13 @@
+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 device's
+ driver link reports the result.
+
+ 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.0
Technical Details
Message-ID:
<20261109-device-trust-core-v2-7-3b12d9a9f861@nvidia.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359078-linux-kernel-netdev=dewy.ruReferences:
<20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359078-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH v2 07/19] driver core: Report deferred probes through sysfs drivers_probe Date: Mon, 9 Nov 2026 09:33:37 +0200 Organization: Usenet Network Message-ID: <20261109-device-trust-core-v2-7-3b12d9a9f861@nvidia.com> References: <20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="298801"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Cfm/eH6dDdPWfm3J8CWXLSQDYeU= sha256:B0cuEJU8wddjPWU9p7HehsOHDgIPIp7eshbCbCkjMv8= sha1:hjA/3V+pgMsOrnbPkCie3YjOroM= sha256:Szb5k6nhY2bELnDMecl0feOC4LXl6L9Un5d6YInRcKM= 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 EB96F113707; Mon, 9 Nov 2026 10:38:11 +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 aumuQyxN7MWS; Mon, 9 Nov 2026 10:38:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-359078-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id D00FF113706; Mon, 9 Nov 2026 10:37:58 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0F1152D28B; Mon, 9 Nov 2026 07:36:20 +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=1794209679; b=OeBnngGr8iYwhPrYWMAU5lgWynP41png3H5iTwC0XvTorj8DoE54OddneiKX+d78A1fe oWGXg/gLyRx40IDmUDcgP9q6e9sqedNpn4xa48reKBmPMCr8uCR//99JFSGEUNazapEBJ IA2gRBuWkheoBBTrh0hqWgs9MbiSfSG74CyUUutt8LFZMvhPot9/a0kBu2X9+RFJuU1rq aLxuRMhHNR4C1dRjyJwb+mQ+trlw700YRPcUAc2ToIIYd/wxsngi1D07tLlQ+yJce6nHV OldlrUj3SO5JbI6RaegJxBtxDj3Inl6kzDxk8UFqLPRIhigaRZ5xgeXs8CcQBM2s/Xg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794209679; 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=Kya3esT+ja5CoFsJojA0B+sdCKA8A1pbdw4lgiA8vnE=; b=dIVM0VBC60cjsz/lvZMGilkkEVDCDYRjJy/eJ54CevVmeL/Z1au02R6yVZKw3cZ+21VA mSmgeTIyQhyviE+xTJoxvz7oRCabylFMXNOgsWWISep0gcTvr/C+DpzdkodHyLDMVui4v WYygyOYyb/Yc2sSJv3It1qrOAu+It/h3o/NrLrNM9DAQ28my+5YKAiPlCTXiMkHBmPsNK tfKjz9w+/3Bb3x2/kM7cCZjNCLEITkY/ZqOBOYXKv0S6xubtEUu5up/nKMvXwchPGea2s ZwnLbGo0TqQSqHdpUEZU7+HcQUZRLBcuvkPPYu7kzSns0xX3HxuBLC/8WVHjEkheIwQ== 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=YfNN0+N4; 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 7B89760A5BE6; Mon, 9 Nov 2026 07:34:39 +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=YfNN0+N4 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=1794209663; b=5sFaYNPrHprXAexrFFK7oIGCBXzsh1he+OYaRPqV1GS7xs+wGegfbbqj0NABqbGtPrkF C9HTvhYn1qPv/fk+u6gcoGrYSEk2Xmncys2oyaJi3+fbkLIJHWPCHs5AsfLEwSQacutbX 1WCtdhWB48wUHmMlq1rAU6dQqppGbykZRJb//P1YTtODHQVL2b4NehYDsvv/jYzTsC3vK tPRIppOLYMY7due0G+ItSU7H//tGugP9ZJ6hjMOioKkXtVMql0PHgRwAgZxwG4A8OJ31T 5qOeG0fTY7CFW+cbYOk0fEEnHWox7NnKC5gVMrH3C9sk+shDzSF662P1AOWB7P5N/kQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794209663; 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=Kya3esT+ja5CoFsJojA0B+sdCKA8A1pbdw4lgiA8vnE=; b=rcrTfWxEaABGTvXPY8DyElQ3bIYpIPDPUEwu/f0ULOV1iuPCTgFuvHqePZhQqhyQzO1t Kw5dunzPrkikeA7YnUzZQXkVjKY9lTSK+nKDMg+ZrM3GK00Q9+AUuoTNzZ5rFf6wJwh0F xQV1NiiWwHLGBJPJWg0Bnw5D3su2Pv+GHaY0kONsynSb9z20dSp48gdBOFNy3GfXARYR1 otpxsskmYOouJpJYQuNvctHtSvQ9lP51i9dwxNft5/lmGhP0CmE/nRRDtWQZ7EewmtmRw mFdZC9aUQFkuo2mFptJlxgUEak+5o1/poaAbcc3k9wnrXiy5QTCu48LE8Z7JIbaXSpw== 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=YfNN0+N4; 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 55DD6606EE81; Mon, 9 Nov 2026 07:34:23 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 238EC1F008A3; Mon, 9 Nov 2026 07:34:22 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794209662; bh=Kya3esT+ja5CoFsJojA0B+sdCKA8A1pbdw4lgiA8vnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YfNN0+N4So4tkvt4WfCeInlWHoD/4kPLBlBnFfJ0JgvY1mvme/G/1EYi9aUGb3Oag wFVlAhC1MDqV/SVGdSnWGm47kMCESUEI74OMDvDo+JYhtNj8BUN2ZYKh4JmwjuJQHu ArBIIDjzsOHKK39DdwkvxeEtJvmc9stNwmFvLuVFXKbaiFLsiuTfd3p7XnyBxYqUxc CXhhAH2yRgcg26kaB2jOkurFASrYlSMgSn/LaV2RUfmBlg4WfJ5ku0hBiwJb5UCSax 2pJhKLrCZgwknCAlZvsKYz6zdBHIbFw1uafrBOdsyIktdv6Z5v6jjNgOPcoMl8Xxz7 n+CuFlQO83Fbg== 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, Jason Gunthorpe <jgg@ziepe.ca> X-Mailer: git-send-email 2.56.0 X-In-Reply-To: <20261109-device-trust-core-v2-0-3b12d9a9f861@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