Re: Broadcom bge(4) panics while shutting down

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 18 May 2009 11:34:28 -0400
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
Received on Mon May 18 2009 - 15:07:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:47 UTC