Date: Wed, 13 Feb 2013 17:04:58 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: John Baldwin <jhb@freebsd.org> 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: <201302131704.58911.hselasky@c2i.net> In-Reply-To: <201302131053.02740.jhb@freebsd.org> References: <201302101036.r1AAaHs1022034@svn.freebsd.org> <201302120843.32349.hselasky@c2i.net> <201302131053.02740.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302131704.58911.hselasky>