The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=564df56098e0b4afb0e45e9bc22b6168b3271071
commit 564df56098e0b4afb0e45e9bc22b6168b3271071 Author: Justin Hibbits <jhibb...@freebsd.org> AuthorDate: 2025-06-25 15:18:46 +0000 Commit: Justin Hibbits <jhibb...@freebsd.org> 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),