Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2009 11:34:28 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        Alexander Sack <pisymbol@gmail.com>, d@delphij.net, Ryan Stone <rysto32@gmail.com>
Subject:   Re: Broadcom bge(4) panics while shutting down
Message-ID:  <200905181134.29076.jhb@freebsd.org>
In-Reply-To: <bc2d970905141645o7afbd749o9439e20f19f5a53d@mail.gmail.com>
References:  <3c0b01820905141202w113966dp4bfbab73d84d585@mail.gmail.com> <3c0b01820905141603g59e439c1y7202532bc1f4f87@mail.gmail.com> <bc2d970905141645o7afbd749o9439e20f19f5a53d@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905181134.29076.jhb>