Broadcom bge(4) panics while shutting down

John Baldwin jhb at
Mon May 18 17:07:41 UTC 2009

On Thursday 14 May 2009 7:45:21 pm Ryan Stone wrote:
> This is hopefully a stupid question, but what's stopping bge(or em, or any
> driver) from unloading and freeing the ifp(and blowing away the module's
> .text section) after we drop the sc lock?

The detach routine is supposed to handle that by blocking until any other 
contexts which can call into the driver are finished.  So, for example, 
bus_teardown_intr() will block if a device's interrupt handler is currently 
running and not return until the handler is fully detached from the interrupt 
resource and when the system knows that the handler is finished executing.  
Similarly with callout_drain() for callout routines and taskqueue_drain() for 
asynchronous tasks.

John Baldwin

More information about the freebsd-current mailing list