From nobody Wed Feb 25 02:21:27 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fLJHc6xMPz6Tbn1 for ; Wed, 25 Feb 2026 02:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fLJHc4VZbz3dYS for ; Wed, 25 Feb 2026 02:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771986092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMnO6zoN6sCMrAAFgnh5gZT4K4FG94QON/ngxCj5BKM=; b=gdx3yac0z6P+mJ3c416vcsrkoq0rXdpRZWKkgsHpoN8QzKrto+/0V0EML643M0jxbbxcAo tC9UzPbZ1tBBn4ji6EOkIw8jff1Qqvf7g601yYAEit6iYnEZnge8JSmRPgE3NuOZTE2Y+m ltOXuXBLsB4Q7fxO0WqDM1M+RFmXzzHUcfe+fKwFHkO1fX5pmTKD/zi5SERzW9FfGY2eHq 5+p6HN0jHRjuLvHCpgiT9LpGNS8+PM4jlrslEPn0od2ySQfxDRfPYjJirqYR9B3UL2Lhag shmx2PjsG6cDGAnNpxR1/T+jojVZ3oXxwXd+w50zrUuwTy8CtWYSNyMLFrz7vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771986092; a=rsa-sha256; cv=none; b=TR7snPi7b0+vJqBfYg+b6TCYifD1JooQmyDjudWludnsfza8sz8lBHQqiH6uEOQ/iwQBOv 5ez1ZeC9LAkqLXSfRtfnQcCfXjdS6Ztu6p2dQf7LNBQ3yBwlvYDE3w9P0gN3qFf3lONUyX oc2wsui3NtufRSfc6apK4TACFVv4ueMYySIV/bItFvCV6wZbI7jfl1cbwNeZ6g6TeIQ7pq l184drEg4dcMmXTlm/w7ixP41oiwFeZ9C+QGRkxA/zjLChkuBqZvvDvaA7zH3xTPSFIyZa MzK0oA4kS56gacsDw0sF2eE0P2ciPgb6D9keDAZxIcT6gOZM0Hax4zc9M9c7Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771986092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMnO6zoN6sCMrAAFgnh5gZT4K4FG94QON/ngxCj5BKM=; b=X3q0hOla2elIrAips8GXC6zM4PRwDgxoyoN0nCS5jJT41zU+Uil1Z1xI8pg7DvHsL9dQLB q/Xy0PaaxQXxe+8znBHoE2tpwdkIR7wskolSWqqWqxwJDr6bzoHGGRpQ3rLXnu5VO19FLE sCNYUtwncdmJRGel1pjyht141VB4GbCHmoFu4hIXDcC+WevfKVpK4V548LPFPwLKJkZ2BS GaLij6hMSQiFE7GWlmOGj1iKwFfQrIhSX9i87A4YRmhj7WBcCYHGAN+1ajmbhsl0KF4yTC C7dB+bGeZLXeM5W9Bx/Y/lwqCJus+VDzC2Pde242Q8gZ5wWQgfyxzzuSfrDrKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fLJHc3lhSzjqM for ; Wed, 25 Feb 2026 02:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2034b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 25 Feb 2026 02:21:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Marcin Cieslak From: John Baldwin Subject: git: fba56be09f1c - main - Do not fail 'devctl clear driver' if another driver is not found List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fba56be09f1c344cc5805b898fbfef6066950942 Auto-Submitted: auto-generated Date: Wed, 25 Feb 2026 02:21:27 +0000 Message-Id: <699e5ca7.2034b.4e9ac9e0@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fba56be09f1c344cc5805b898fbfef6066950942 commit fba56be09f1c344cc5805b898fbfef6066950942 Author: Marcin Cieslak AuthorDate: 2026-02-25 01:58:59 +0000 Commit: John Baldwin CommitDate: 2026-02-25 01:58:59 +0000 Do not fail 'devctl clear driver' if another driver is not found Detaching the bhyve(4) ppt driver from an unsupported PCI device should not raise a "Device not configured" error. We do not expect that a new driver must take over the device in this case. Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D52050 --- lib/libdevctl/devctl.3 | 3 ++- sys/kern/subr_bus.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/libdevctl/devctl.3 b/lib/libdevctl/devctl.3 index c8a4704825c2..94fe350e524b 100644 --- a/lib/libdevctl/devctl.3 +++ b/lib/libdevctl/devctl.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 4, 2019 +.Dd February 24, 2026 .Dt DEVCTL 3 .Os .Sh NAME @@ -193,6 +193,7 @@ is true, the device will be detached from its current device driver. After the device's name is reset, it is reprobed and attached to a suitable device driver if one is found. +If no suitable device driver is found, no error is reported. .Pp The .Fn devctl_rescan diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index c9d64e3674c6..b5c1c5b61f60 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -5961,7 +5961,19 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, dev->flags &= ~DF_FIXEDCLASS; dev->flags |= DF_WILDCARD; devclass_delete_device(dev->devclass, dev); - error = device_probe_and_attach(dev); + + /* + * Don't use device_probe_and_attach so that failing + * to find a new driver isn't reported as an error. + */ + error = device_probe(dev); + if (error == ENXIO) { + error = 0; + break; + } + if (error == 0) { + error = device_attach(dev); + } break; case DEV_RESCAN: if (!device_is_attached(dev)) {