From nobody Wed Jun 25 20:02:02 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 4bSCQM1k0Rz60SXv; Wed, 25 Jun 2025 20:02:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSCQM08v5z3Gm1; Wed, 25 Jun 2025 20:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881723; 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=ShHGUaPBtaKqTruVgcUdPPo5ntfBWzIoIkaM3EwMc8s=; b=akUTMjg1xbmuii5u8pFuiE2RfEMCGQFTRd8Xbic3qWVI+SHDQftpYX2NeIdDQmEtInfbl2 gc7Ex3doz67UuGBRdnPQOsS6D3bRzclGrjxa18pbnJfIauP0cJkIYA2zG1E/E09i4nGFgn lFnUvWH8AYsjHByjXRH6ksFZod7YoBG1xLnUsrS5JO4OvM4H7FX6b4uUWg4RmJ7bhaokfj xEGTEFtC7tBx3h1YTSgPLiS4rhhPhvaTIQom1NIP0PK0JycQ68i9i4uqbfuHQX1tjXQNck PvwKjH7RvIM+4070wP6rLvj0Ihb0hapWaOrraL4lr+QTspLvoGV7ZazBDmkwBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750881723; 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=ShHGUaPBtaKqTruVgcUdPPo5ntfBWzIoIkaM3EwMc8s=; b=hZRgGHjCD8W1Y11766nVA1Hs2LRKWfTKuuJIFeNGG7IIRrWi4PSQXNQ7h6BkUFnYc3lGsE Jbd31I3VmR/u1swuXB5PUvuJ8eEs9EwYOmojUx5Pllp7ppjAUmz/Jm682Qt6+VWDNr00ca BzNfLdzesqkUCPdmoFeAqwy7c5x3vUw0LtmvrWDFNwzDVezD1A2mOyYrJqXutlP0qpFcmR yAF2NHttt+VofP/ibBK+GkB48Ve7luY/oHs1GSgHn1nDpFUfyyBtNCyrCGNTLLdHRnKnLr 61AJJP6UBUiqM9Lf0by/+FepmK9PiUZyBx0gjMCXK1wVUMDx+zAIHCVmINd4yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750881723; a=rsa-sha256; cv=none; b=OmKa5U93tFTTMA5CIRjsvXe3I6YPEWEhfUu1yQ1t6e576paCPnw4nmK4rEuAmbfgP5GwuC 7p9K4XqxNhr/Kq8eQt4B4gmOk6qUTjq5duTZwVHw3xLyhq6OiHMKJXWYNv6UCMWBPJSMFf ST8gBKLYnU1E5LyWiYpRl/hY35YLvLMVVLS55/mf+pNE1estyly6lUcC/msXWYVSVicdtO b8/AGDm3jdsJtawcWMOZqyeToW0cPucGyKc9a0xJk4E1zMDvB8dU9oOG/Atpz7kXka/Vj/ IMqEVRi64W7B7vCIHjx3t1lgwNCzBazCcuXCv5qW+aVCd4xCugr9gZTbEE3i2A== 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 4bSCQL6ZMLzY6w; Wed, 25 Jun 2025 20:02:02 +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 55PK22TY079625; Wed, 25 Jun 2025 20:02:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PK22Zn079622; Wed, 25 Jun 2025 20:02:02 GMT (envelope-from git) Date: Wed, 25 Jun 2025 20:02:02 GMT Message-Id: <202506252002.55PK22Zn079622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 564df56098e0 - main - nexus: Add device_shutdown where missing 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: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 564df56098e0b4afb0e45e9bc22b6168b3271071 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=564df56098e0b4afb0e45e9bc22b6168b3271071 commit 564df56098e0b4afb0e45e9bc22b6168b3271071 Author: Justin Hibbits AuthorDate: 2025-06-25 15:18:46 +0000 Commit: Justin Hibbits CommitDate: 2025-06-25 19:53:24 +0000 nexus: Add device_shutdown where missing At shutdown devices may need to do extra work to clean up state, etc. This is done in a device_shutdown kobj method on a driver, with the default being a `do nothing` method. Only x86's nexus driver includes the device_shutdown method to propagate down to its children, so on other architectures the device_shutdown stops at the root, and thus device_shutdown is never called for any real devices. Add this missing method to the nexus drivers of the other architectures so devices have a chance to properly shutdown. Sponsored by: Juniper Networks, Inc. --- sys/arm/arm/nexus.c | 1 + sys/arm64/arm64/nexus.c | 3 +++ sys/powerpc/powerpc/nexus.c | 1 + sys/riscv/riscv/nexus.c | 1 + 4 files changed, 6 insertions(+) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 3653d7087a5c..c0a79736c665 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -114,6 +114,7 @@ static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), /* Bus interface */ DEVMETHOD(bus_add_child, nexus_add_child), diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 2de996447edd..26b3389db172 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -126,6 +126,9 @@ static ofw_bus_map_intr_t nexus_ofw_map_intr; #endif static device_method_t nexus_methods[] = { + /* Device interface */ + DEVMETHOD(device_shutdown, bus_generic_shutdown), + /* Bus interface */ DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_print_child, nexus_print_child), diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index 029b6ef8a479..313b1f4792b9 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -86,6 +86,7 @@ static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index 836e1648edeb..d08274aba9b2 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -100,6 +100,7 @@ static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_fdt_probe), DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), /* OFW interface */ DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr),