From owner-svn-src-head@FreeBSD.ORG Wed Feb 13 16:03:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 19ED93A9; Wed, 13 Feb 2013 16:03:50 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2C183CE3; Wed, 13 Feb 2013 16:03:48 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 203643023; Wed, 13 Feb 2013 17:03:47 +0100 From: Hans Petter Selasky To: John Baldwin Subject: Re: svn commit: r246614 - head/sys/dev/usb/wlan Date: Wed, 13 Feb 2013 17:04:58 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201302101036.r1AAaHs1022034@svn.freebsd.org> <201302120843.32349.hselasky@c2i.net> <201302131053.02740.jhb@freebsd.org> In-Reply-To: <201302131053.02740.jhb@freebsd.org> X-Face: ?p&W)c( =?iso-8859-1?q?+80hU=3B=27=7B=2E=245K+zq=7BoC6y=7C=0A=09/D=27an*6mw?=>j'f:eBsex\Gi, Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2013 16:03:50 -0000 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