]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mpi3mr: Reduce the scope of the reset_mutext
authorWarner Losh <imp@FreeBSD.org>
Wed, 29 Nov 2023 01:49:08 +0000 (18:49 -0700)
committerWarner Losh <imp@FreeBSD.org>
Wed, 29 Nov 2023 01:49:08 +0000 (18:49 -0700)
commit7c4913093a759adf2e4c7d65535aee04aadee4df
tree15a276190635cb4b8d2b682a8a0718158a72eeb9
parenta2b046620c54db977196128b3c53da2704b9fd20
mpi3mr: Reduce the scope of the reset_mutext

Reduce the scope of reset_mutext to protect the msleep in the watch dog
thread as well as the MPI3MR_FLAGS_SHUTDOWN bit. Use it to protect the
wakeup in mpi3mr_detach so this thread can exit sooner when we're trying
to do an orderly shutdown. Optimize the flow to check the sleep and
other conditions before going to sleep.

It's an open question if this should protect sc->unrecoverable, and if
we should wakeup the watchdog thread when we set it. We might also want
to move too booleans for the three flags that we have now in
mpi3mr_flags. There are a number of U8s that should really be bools and
we might want to also group them together to pack softc better.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D42539
sys/dev/mpi3mr/mpi3mr.c
sys/dev/mpi3mr/mpi3mr_pci.c