svn commit: r246614 - head/sys/dev/usb/wlan

Hans Petter Selasky hselasky at c2i.net
Wed Feb 13 16:03:50 UTC 2013


Hi,

On Wednesday 13 February 2013 16:53:02 John Baldwin wrote:
> You shouldn't call routines that can drain like if_detach() or
> destroy_dev()  or the like while holding any mutexes period.  I think you
> need a 0) step which is "detach external consumers" including cdev's
> (destroy_dev()) and ifnet's (if_detach).  Once both of those routines have
> finished, you can then proceed with actually stopping device operation,
> and 2) is not needed as it can't happen once 0) has finished.
> 

Right.

> When a device has both an ifnet and a cdev you may need something to
> handle  the case of one part being dead but not the other.  For now you
> can call if_detach() first as it doesn't sleep (though that is a
> bug).  The real fix for this case (and things like tun(4) can need this as
> well) is to have a way to call just the non-blocking parts of things like
> if_detach() and destroy_dev() first to mark the relevant portions as dead
> and then follow those with blocking calls that do the drain.  This is all
> part of step 0 though.

I feel this is out of my area. Can you push the right people to make such a 
change in the IFNET code and I can update the USB part.

--HPS


More information about the svn-src-head mailing list