From nobody Sat Jan 11 04:03:51 2025 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 4YVPyv5F8lz5l9x8; Sat, 11 Jan 2025 04:03:51 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPyv3Y0Xz4VT7; Sat, 11 Jan 2025 04:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rlEmPGB3XLt7kZU8O9hw6MeUY25b3YwFSnLosYaR/6I=; b=Kw2qEbKhKmoZRIJgu3byj7YvA8N7O9dvaqekSqHWUGVLSbWFxMLmX7bGpBdE/VSyFVQvKl X/WJOJH3riMIcAAZ2N2OZpj1t4rZw/RvBhC3YZXicl+1vC9G8GK7rUvSM5mn/yGWisbpjX YZhgtYtI1Pbpox6IYYMZAvrpAtIqNXfd2QPnZva9lrvuaZ18iLflPp5sNe00ZChc25DQpS f//Bs83760lvPc7eo4E+RE3A38R/CgGpreImzsTZTZmtGYxi69AYKWNwxROXCHP/mXy+cw s7U0eyRWKGbOdX0OJ/PhQag7RlagNfNRC2RwxaYlwwjixi2eNK+QbDdLzPuGGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rlEmPGB3XLt7kZU8O9hw6MeUY25b3YwFSnLosYaR/6I=; b=lm+dy+tmeL/p5k31O1OJjZMycL/CuWXs9AI5utxZ0tobADTLS3rQVojHtdIufDZby5QORR 66bbPX+YopbkHoALz/jYhGahMFK3GuFan44dUf31AwjFpGshPdrInRvbHelqQ1WH15NtUV K7pagw6sDeuFdQnEPFDHeuNRXvsqZwyjCGsGM0ciVIq+PwSHXXPnPVj6A4QJOneyvnrHmX hyI4E545WiLklfFFGCwRZVtFtLUE+4qYUQ9W9KQUl2yGWP73tHoP+fOZMe8ZhCnkmDYGTf E0vvgufHJIg3vgcnvPLXctzqBNVCUeDE2dcwVswHlybrONYqs4ymrLt99FW3Bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568231; a=rsa-sha256; cv=none; b=Em+N5aZE9ZKn3//sRxW8AdA4htta8/fa5so2XjjIx8wC0A6bSxekETOsSbxQOS43SJFkRE jB8YYdHa31CXria/deQOgzJsIZV53rGcGv8UHjzHV9OQiBl5NMXDCIAPk11GEv2MqlNhTm +O1hbWNwnku93aOpfFnmY5ySoiv4Yhj7Vt849DOdqe4Kj6b7fq1FRuqEwf+hETVqKj38xC bCSqO1ExqkDja90licTDoq1R1CRRdC9G6N1BUA/6wXh0POjupZ+2/q5tit4j0vqhroI8HC E5CuW7USx4tLjJhCSwoJ34UZuDme4XcbzSa2Vj2Y88FNSYEy4jlrLzQ/IAkQFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPyv2tMXzjVK; Sat, 11 Jan 2025 04:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43pPA017762; Sat, 11 Jan 2025 04:03:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43pw8017759; Sat, 11 Jan 2025 04:03:51 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:51 GMT Message-Id: <202501110403.50B43pw8017759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8e4535ee5870 - main - stand/kshim: Implement bus_detach_children 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: 8e4535ee5870b76f97f6d33a05e9979dcb75c185 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e4535ee5870b76f97f6d33a05e9979dcb75c185 commit 8e4535ee5870b76f97f6d33a05e9979dcb75c185 Author: John Baldwin AuthorDate: 2025-01-11 04:02:27 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:32 +0000 stand/kshim: Implement bus_detach_children While here, update bus_generic_detach to delete devices as in the kernel. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48410 --- stand/kshim/bsd_kernel.c | 13 ++++++++++++- stand/kshim/bsd_kernel.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index 78b6f9e0b4d4..371aaa6e96bf 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -664,7 +664,7 @@ device_get_unit(device_t dev) } int -bus_generic_detach(device_t dev) +bus_detach_children(device_t dev) { device_t child; int error; @@ -679,6 +679,17 @@ bus_generic_detach(device_t dev) return (0); } +int +bus_generic_detach(device_t dev) +{ + int error; + + error = bus_detach_children(dev); + if (error == 0) + error = device_delete_children(dev); + return (error); +} + const char * device_get_nameunit(device_t dev) { diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 8600bd1f31dc..25a779d5ea0c 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -650,6 +650,7 @@ void bus_release_resources(device_t, const struct resource_spec *, struct resource **); struct resource *bus_alloc_resource_any(device_t, int, int *, unsigned int); void bus_attach_children(device_t); +int bus_detach_children(device_t); bus_space_tag_t rman_get_bustag(struct resource *); bus_space_handle_t rman_get_bushandle(struct resource *); u_long rman_get_size(struct resource *);