Date: Wed, 13 Feb 2013 11:45:18 -0500 From: John Baldwin <jhb@freebsd.org> To: Hans Petter Selasky <hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r246614 - head/sys/dev/usb/wlan Message-ID: <201302131145.18556.jhb@freebsd.org> In-Reply-To: <201302131704.58911.hselasky@c2i.net> References: <201302101036.r1AAaHs1022034@svn.freebsd.org> <201302131053.02740.jhb@freebsd.org> <201302131704.58911.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, February 13, 2013 11:04:58 am Hans Petter Selasky wrote: > 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. For now because if_detach() is broken I think you can just call ether_ifdetach() and then destroy_dev(). -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302131145.18556.jhb>