kldunload and device detach panics
Duncan Barclay
dmlb at dmlb.org
Mon May 26 12:22:03 PDT 2003
Hi
Whilst starting work on porting the Linux Broadcom 440x 10/100 driver I've
come across a bit of
a problem with kldunload and its interaction with device xxx_detach.
I'm cribbing code from if_bge.c and if_rl.c (picked at random). if_rl.c uses
a mutex for locking the softc. If the rl_detach routine is called twice (for
example failing attach and then kldunload) the mutex gets destroyed twice -
leading to a panic with witness.
Is there a safe sequence of mutex checking etc. to avoid killing the machine
in this way? At present I'm assuming that if the mutex is not initialised
then _detach doesn't need to clean as nothing could have been set up, or it
has already been cleaned.
Duncan
More information about the freebsd-current
mailing list