🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21665

[PATCH v4 15/33] driver core: Report deferred probes through sysfs drivers_probe

#21665
From: Leon Romanovsky
Date: Tue, 24 Nov 2026 09:43
84 lines
11165 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: <20261124-device-trust-core-v4-15-037eb0d17b1f@nvidia.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370181-linux-kernel-netdev=dewy.ru
References: <20261124-device-trust-core-v4-0-037eb0d17b1f@nvidia.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370181-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v4 15/33] driver core: Report deferred probes through sysfs drivers_probe
Date: Tue, 24 Nov 2026 11:43:46 +0200
Organization: Usenet Network
Message-ID: <20261124-device-trust-core-v4-15-037eb0d17b1f@nvidia.com>
References: <20261124-device-trust-core-v4-0-037eb0d17b1f@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4104424"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:cckz9cePazdMTVCott4UG6RVzHc= sha256:shFJeAe9c+1DNLTj+2Wv6Tr7Dm+mXxrfSdKNfpUxfu0=
	sha1:b6EzzoF0t2iiscOMpa2LHj4qBkY= sha256:E1dHSria+MTVeeyllAjwemrOcQIidPrJWhLXIr+lS8Q=
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 C2362125DEE; Tue, 24 Nov 2026 12:48:13 +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 v_KudRSldNTU;
	Tue, 24 Nov 2026 12:48:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370181-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9371D125DEB; Tue, 24 Nov 2026 12:48:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7A1FD449E7; Tue, 24 Nov 2026 09:47:01 +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=1795513540;
	b=bZ9QTqGfWktXY6eoYj+MmID3tRPIr28cQzuvjVkYnIoE0A3l+2iiOHTMQSgYWjE02EWb
	 i7fDEo0n8qrCXyv6yWU2V2+r+oLLUctgfvf4N46TCOpaILlT/u5V6cgY77cv6t/az55I3
	 cmeVFSfZwVeOzvyE6iWTu+oFXlpSWaFiP0bciANErWB/wSTjDMbneUWD/hYScQlbc/Nue
	 2CC0dy3xz7GFUfMeRKgBdw3WH22/Y6i/2fWJpCQ2wi8paknHC8jhSxb/Vsu2j7vRmJ21P
	 6CvF5UjVR9R8pQU/Apb5NcqU6c+2atGsWcRSiKbB9Rrqrnu10XwDWqiN6Urznc5v/Yw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795513540;
	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=FnuM0a1QWyyGp9VfiI8yM9k80Xj8S9Jp3ao12dq9xVgTQp32zEatydpa0sJVnYAtXQtn
	 KgT6q/Mnvf8P1F+qcEZ/ee4XQzeeQV9mpjMj96d38Xm8V540Gy3nRgpoxuq3OspsbTlF3
	 DiMCekU2naMqIe6vNGUWfsPHmvjoVcmm7j32YcpRln8GzorDDqH+f5L/WHOHTGvCPpEiJ
	 Wfgx60Z0T+etR+h1hrIE7mY7PTp61DBjxCMTzULoiqsR2b4jn8WP2WfEN3U0yA8SLtGu6
	 6lv5oehb/6RgywOr7wsTf86H2t6hLM+k3nZ7YuBPdYqa/k/Jt7sCinOeSMG4eFS+/1g==
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=nnHik31J;
	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 650CA60A5BE5;
	Tue, 24 Nov 2026 09:45:40 +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=nnHik31J
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=1795513529;
	b=NsKTHZSJOLmOSakE2x+1JzlwqMUNSJlukRt+HNfe3bFD0c/YofsWeEjy9gfDP7Mk6gFG
	 uCQh5DZENiKBYhdeefJoLhiQPphygmVM7f9tBk7QCZ2VmM6UW9Tbd/aIycYjF9ZNztsQH
	 pyZh8cEuUkl6QOwb/+lOUdYmw3e56S5xTpyxqKfyxwerId4JkJxptnd4Z9NhsZ2ZnJO+I
	 W1qw2U5SjUHT+nFWcXUUopOxAJg22lk02TwRHGXXIntM6j3p39dS11O9aZl+z6DzrBx4D
	 WAGUOn0lt1WKRrqJiLCFuseHlxL885z+YULUHk5NQ+reDLR003NPzVKvZKAGINeh7LA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795513529;
	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=hD+gFyMGeFGQaiiIDBJxxKXQ3tvNvna7TnJG9KVl1wsitQfRupY/qDPeZ+FFKm3B++at
	 E4mrx+dmTcCbSUAAMmTET8EGJqvhAM05A4vfHCpPLayjXbbhZOsMeaScC2eFIqrxuz+IL
	 0xVQZ+Epw/3wXV7vVIjkxcOaF07nV5Zkk8FLWn4eFR5MWp1Z9QV6i0J79GCkqT+oo5CMk
	 duySJX8MU3PqxbkdttdFmDqshKp9qLS6lniAkEXrLyxNEQhBebYYAu3gwVu6RClOniFNJ
	 gRAZjEhl3op9GVJHTFAp2erBbxXHGv81SByAjO+wwcYduks+F0m2/J8b2/CttNWPCbQ==
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=nnHik31J;
	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 80E2460A2607;
	Tue, 24 Nov 2026 09:45:29 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10B1A1F000C4;
	Tue, 24 Nov 2026 09:45:28 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795513529;
	bh=AI23EedCHOkVt2bUFVxVq0Tw4jV6qHaXsCMKfKtBCb8=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=nnHik31JyN/Y3TS9cyBiDeVRA00Ub5gX3cbTGh5LLBhpP23T1U52BZf4Z3OXrcbY4
	 whWIq5d7u/lP5039cdtVPaeBNWaoyZkH343rSPE3yYysFNt6Z1+xh8hmVMgwstoXBZ
	 O8DiJJUb4YTDb1FUZnp7XskQSA5mcrL49QyGzXh0NlfvsyWF88vKOejkr2dlkdzeAD
	 7GjXVqLpdb5QnUIJFVvJIY/v6UIL1rJOeAgsV4aeVu6m4yeDgK0RptHlm10daF1DWZ
	 f0fmo265bGWWnLUn9NTXM8iNkDKUIwkv/PrqdITUo25T2QoKRdDZvZ1m0QbGp8Nkba
	 cAX09au3hVw6g==
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: <20261124-device-trust-core-v4-0-037eb0d17b1f@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