[Midnightbsd-cvs] [MidnightBSD/src] 45dcf7: new-bus: Fix some shortcomings in disabling device...
Lucas Holt
noreply at github.com
Sun Dec 1 13:54:59 EST 2024
Branch: refs/heads/master
Home: https://github.com/MidnightBSD/src
Commit: 45dcf7af6aee96afa32250a312f963f892235e45
https://github.com/MidnightBSD/src/commit/45dcf7af6aee96afa32250a312f963f892235e45
Author: Lucas Holt <luke at foolishgames.com>
Date: 2024-12-01 (Sun, 01 Dec 2024)
Changed paths:
M sys/kern/subr_bus.c
Log Message:
-----------
new-bus: Fix some shortcomings in disabling devices via hints
A device can be disabled via a hint after it is probed (but before it
is attached). The initial version of this marked the device disabled,
but left the device "alive" meaning that dev->driver and dev->desc
were untouched and still pointed into the driver that probed the
device. If that driver lives in a kernel module that is later
unloaded, device_detach() called from devclass_delete_driver() doesn't
do anything (the device's state is DS_ALIVE). In particular, it
doesn't call device_set_driver(dev, NULL) to disassociate the device
from the driver that is being unloaded.
There are several places where these stale pointers can be tripped
over. After kldunload, invoking the sysctl to fetch device info can
dereference dev->desc and dev->driver causing panics. Even without
kldunload, a system suspend request will call the device_suspend and
device_resume DEVMETHODs of the driver in question even though the
device is not attached which can cause some excitement.
To clean this up, more fully detach a device that is disabled by a
hint by clearing the driver and setting the state to DS_NOTPRESENT.
However, to keep the device name+unit combination reserved, leave the
device attached to its devclass.
This requires a change to 'devctl enable' handling to deal with this
updated state. It now checks for a non-NULL devclass to determine if
a disabled device is in this state and if so it clears the hint.
However, it also now clears the devclass before attaching the device.
This gives all drivers an opportunity to attach to the now-enabled
device.
Obtained from: FreeBSD 13 stable Dec 1
Commit: f5b9744bbec1c479439c78c4e0a0cd258563c09b
https://github.com/MidnightBSD/src/commit/f5b9744bbec1c479439c78c4e0a0cd258563c09b
Author: Lucas Holt <luke at foolishgames.com>
Date: 2024-12-01 (Sun, 01 Dec 2024)
Changed paths:
M sys/amd64/amd64/fpu.c
M sys/dev/gpio/gpiobus.c
M sys/dev/gpio/gpiomdio.c
M sys/dev/iicbus/iicbus.c
M sys/dev/iicbus/iicoc_fdt.c
M sys/dev/mii/mii.c
R sys/dev/mii/mlphy.c
R sys/dev/mii/tlphy.c
R sys/dev/mii/tlphyreg.h
M sys/dev/msk/if_msk.c
M sys/dev/nvdimm/nvdimm_acpi.c
M sys/dev/ow/ow.c
M sys/dev/pci/fixup_pci.c
M sys/dev/pci/ignore_pci.c
M sys/dev/pci/vga_pci.c
M sys/dev/sk/if_sk.c
M sys/dev/smbus/smbus.c
M sys/dev/sound/pci/csa.c
M sys/dev/superio/superio.c
M sys/i386/i386/npx.c
M sys/isa/isa_common.c
M sys/kern/kern_cpu.c
R sys/netinet/libalias/alias_cuseeme.c
R sys/netinet/libalias/alias_old.c
M sys/netinet/sctp_asconf.c
M sys/netinet/sctp_bsd_addr.c
M sys/netinet/sctp_output.c
M sys/netinet/sctp_pcb.c
M sys/netinet/sctp_pcb.h
M sys/netinet/tcp_output.c
M sys/netinet/tcp_stacks/bbr.c
M sys/netinet/tcp_stacks/rack.c
M sys/netinet/tcp_syncache.c
R sys/nfs/nfs_fha.c
R sys/nfs/nfs_fha.h
R sys/nfs/nfs_lock.c
R sys/nfsclient/nfs_bio.c
R sys/nfsclient/nfs_kdtrace.c
R sys/nfsclient/nfs_krpc.c
R sys/nfsclient/nfs_nfsiod.c
R sys/nfsclient/nfs_node.c
R sys/nfsclient/nfs_subs.c
R sys/nfsclient/nfs_vfsops.c
R sys/nfsclient/nfs_vnops.c
M sys/riscv/sifive/sifive_spi.c
M sys/x86/isa/atpic.c
M sys/x86/isa/atrtc.c
M sys/x86/isa/clock.c
M sys/x86/isa/isa_dma.c
M sys/x86/x86/legacy.c
M sys/x86/x86/nexus.c
M usr.sbin/devinfo/devinfo.c
Log Message:
-----------
tcp_output: Clear FIN if tcp_m_copym truncates output length
Cleanup bus child deleted methods on multiple items. Some don't have
children. Others need proper routines.
Remove some old nfs files.
output device description in devinfo
Obtained from FreeBSD 13 stable Dec 1
Commit: 524fa3f848049182f496e523819343a712337f39
https://github.com/MidnightBSD/src/commit/524fa3f848049182f496e523819343a712337f39
Author: Lucas Holt <luke at foolishgames.com>
Date: 2024-12-01 (Sun, 01 Dec 2024)
Changed paths:
M stand/i386/boot0/boot0.S
Log Message:
-----------
align
Commit: 97de9727d95d0e7f1e724f056bb9c1b843fbed91
https://github.com/MidnightBSD/src/commit/97de9727d95d0e7f1e724f056bb9c1b843fbed91
Author: Lucas Holt <luke at foolishgames.com>
Date: 2024-12-01 (Sun, 01 Dec 2024)
Changed paths:
M bin/echo/tests/Makefile
M sys/arm/xilinx/zy7_qspi.c
M sys/arm/xilinx/zy7_spi.c
M sys/cam/ctl/ctl.c
M sys/kern/kern_linker.c
M sys/kern/subr_param.c
Log Message:
-----------
sync up some changes
Commit: 3809ad86ad6b1c8f269f6c99b5e365c497af1eb3
https://github.com/MidnightBSD/src/commit/3809ad86ad6b1c8f269f6c99b5e365c497af1eb3
Author: Lucas Holt <luke at foolishgames.com>
Date: 2024-12-01 (Sun, 01 Dec 2024)
Changed paths:
M usr.bin/grep/grep.c
M usr.bin/grep/util.c
Log Message:
-----------
default to -p instead of -S to match man page behavior for grep
Compare: https://github.com/MidnightBSD/src/compare/2c2f48caf920...3809ad86ad6b
To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications
More information about the Midnightbsd-cvs
mailing list