🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26329

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

#26329
From: Leon Romanovsky
Date: Thu, 03 Dec 2026 12:03
84 lines
11215 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 000000000000..ed8828e55d6b
--- /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 93abbb315065..b726344362b4 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 396097fdb316..ecff32c3704b 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: <20261203-device-trust-core-v5-15-485cc6eddd46@nvidia.com>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376549-linux-kernel-netdev=dewy.ru
References: <20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376549-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v5 15/33] driver core: Report deferred probes through sysfs drivers_probe
Date: Thu,  3 Dec 2026 14:03:37 +0200
Organization: Usenet Network
Message-ID: <20261203-device-trust-core-v5-15-485cc6eddd46@nvidia.com>
References: <20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2480715"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uAryebRyRhnXq1htJz3vGSeFbk4= sha256:SoW/ykoLm4b9VEPsj3wBc7FL8PnZTEmr59ZxrLzsDIE=
	sha1:7/gw6pCg97gUSi8DvoMwOKUmX4Y= sha256:9MyQnip4lQjtjWVGPvZAEODuG7kDKJv4Xs4JJwweNSg=
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 76BA0117911; Thu,  3 Dec 2026 15:07:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.64
X-Spam-Status: No, score=-2.64 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DKIMWL_WL_HIGH=-0.24, 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 EctR3KifY5lE;
	Thu,  3 Dec 2026 15:07:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376549-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 5D35B117904; Thu,  3 Dec 2026 15:07:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id EADEF603974; Thu,  3 Dec 2026 12:07: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=1796299498;
	b=Y/XwXfSi432JFXUAP/pSLHOEsaAW1LhvPoRT+HaxZaMmwfdnds56/s0zo+oupIWGJb6H
	 8ka7y8tTnsYqpXfrzymT9dRoFipJmiretrmSW1eV5j5tSJLFFEZmgPmxr8pSKdQmQWCfe
	 C2KQyf42wro9y7m6rg2zGAmC+ZBum7fixYayae4Nk7CZ2wM4G0rIwPUCPMZ41ZDu8/2eW
	 gdywt2NnnjsfmQMNLjcbBuV2cBPjwsaqJAJ5f+a2ZR2TrsMsIydPlGKk+YLfmq6mnFB9l
	 wV1DfVFAIYPKkEe1k5oAEVVS+J/I2cAkpryLelvFCYP0jlj5gYl+qUNvL1fKFsG7Gaw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796299498;
	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=C6L/l8OLYFXxOLTBD1/NLFDf7kkfSVj3Bh8mJUBUGdY=;
	b=RmaBsEDI7oWD8PhVakfD8FaHnZfg9eQCvkbjiSs4fFNQx4hPyCCyKKSF9iAAAGiy40jM
	 SYauczwDCNtLJ2WOXKyM0vBSntD4si9ZsTfvobIAR/VTXvZ8aAOrfVcpWgVhe7FCdLlDG
	 XA+80UvIbHYRtmszQRwOnUC6QRRofQcpBH61EUimEs745Rskq8KbMEDagezgiAiZlKhYG
	 u24pzDTjESJNNP/tU77LIXivXayZQ0VnnW+mMPkusp1XSKxiWaLF7ljHqMBg3cYyc7GtD
	 xFXXVlmbLSLKSAc7UfmsmH57TuMGKztxvDyo/1pV5TkhM5MufrxZSVypNpZHmm5TFkQ==
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=Os7Y8j7m;
	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 3BD9D606F2AE;
	Thu,  3 Dec 2026 12:04:58 +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=Os7Y8j7m
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=1796299487;
	b=nRRMWiO+Ffa6R2L10Uw1YvM7SYo3H1Cl/Xp6/IgQ11V2KneiTQxOoQ0e0y2QbM6UWKaD
	 tEeMHn6odbkD6/rgX9GhpMe10h+9dNwxmd1KTWDG5oSAc3VRDZeV0oMYQrN759CJoFoqR
	 WEzHmNP1il8zhgPtUAoE6xTXgZ5/nMDlkUOPn5+Sx3xp9c3gF0+SjuZQ/2iUHbYp3wDUI
	 SAvH/V8CI/+Xl/k/Ck5OQm7tqgDbTlBNeUAOmRYtyI0GFaMfnmDnORiSU/23lHkcds4of
	 55YRSLem/CTITAOFmSZojCG6GxVyfX7E6Gm9dogjE1S73WI7/gSXNjlf+VSQG9/ABMQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796299487;
	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=C6L/l8OLYFXxOLTBD1/NLFDf7kkfSVj3Bh8mJUBUGdY=;
	b=TQfiwv/7+j9gw/IH+lbKguI8iZ00jAEHUESst9j/fLKDUjdkMhRH2qtv9wG1Oi5IuQvE
	 F99Q9AZuHFJvDA+Fzb6u3NGdKScStEzTEgVtXzH0zRRQyepf9cHQbINTKs8R3/0BO4t4L
	 cVD8a236l4uWhoCQR8AMElwMNdNbRO3mZFNFLKoIGwrHMFoQJWkKW+RTaPB6SXbGaVExX
	 1HK4zP3r/O8PQbTQaXieKdWQ3kfVDGFXu5EgMs72ksBE4XOX98IVQ4Rd1nM6n0kFFXfg8
	 kQEFheLnjxsGvrZu/hgxpoPYEQWAaQf4ErPBm14JkOBCM2Xp73iqt57tvyyEOfBux0g==
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=Os7Y8j7m;
	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 56274606DC8F;
	Thu,  3 Dec 2026 12:04:47 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B641F0089F;
	Thu,  3 Dec 2026 12:04:46 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796299486;
	bh=C6L/l8OLYFXxOLTBD1/NLFDf7kkfSVj3Bh8mJUBUGdY=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=Os7Y8j7mQ89HHO6QfoYDFl3GBlXMGvvjbPN3sl+edH7YMO/CwMXMvZk03ymW0W/OI
	 obirJHosgNC2oItEBlLtnAwbR7aCcv/LPt2vi+BF/VqFysDs2AwXFLfphr5fnpCo2Q
	 myexlfHehDiE5DDMW4eyuGEoJLY8YVvqCRSw06ZSx4dwWA20zK6N8cYfBjaz+jotli
	 4N9BHql/nAhJoWNGkQY2d04RmnzNTUN8raUSm3qvV4tEqleb26CQljdlmEgakiC3TV
	 VH8BU1V8H3nHkxbfUdS8wS6so3DycOcQ/+7qCxXYeykBuxjPoacXhoCVyAn8KP6yBr
	 RAiEwPGeOv3qg==
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: <20261203-device-trust-core-v5-0-485cc6eddd46@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.17-dev-d2b70