From owner-freebsd-current@FreeBSD.ORG Mon Jul 19 22:42:27 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51F2616A4CE; Mon, 19 Jul 2004 22:42:27 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF6B043D39; Mon, 19 Jul 2004 22:42:26 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.0.12] (g4.samsco.home [192.168.0.12]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i6JMmPut055768; Mon, 19 Jul 2004 16:48:26 -0600 (MDT) (envelope-from scottl@freebsd.org) Message-ID: <40FC4E0C.1040404@freebsd.org> Date: Mon, 19 Jul 2004 16:41:16 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040514 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <20040719175241.GJ57678@darkness.comp.waw.pl> <200407191950.aa12733@salmon.maths.tcd.ie> <20040719.163751.16873514.imp@bsdimp.com> In-Reply-To: <20040719.163751.16873514.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: iedowse@maths.tcd.ie cc: freebsd-current@freebsd.org cc: pjd@freebsd.org Subject: Re: Unloading USB driver while device is attached. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2004 22:42:27 -0000 M. Warner Losh wrote: > In message: <200407191950.aa12733@salmon.maths.tcd.ie> > Ian Dowse writes: > : In message <20040719175241.GJ57678@darkness.comp.waw.pl>, Pawel Jakub Dawidek w > : rites: > : >So, as I see it, device should be totally detached before unload and > : >I susspect that something is missing in USB layer, not in all drivers. > : >That's why when I load a driver again, USB thinks it is somehow connected > : >to existing device, but it isn't. > : > : I'm not sure if it will help in this particular case, but I have a > : lot of local cleanups and improvements in the USB code. There's a > : large patch at > : > : http://people.freebsd.org/~iedowse/usb.diff > : > : but unfortunately I haven't had time to work on this lately (and > : there are all the problems of divergence from NetBSD etc. if bits > : of this get committed). The (small) uhub.c changes look like they > : might possibly help in your case. With the full patch I was able > : to `kldunload usb' without crashes a while ago, but there were still > : memory leaks. > > Personally, I think that divergence from NetBSD is less of a problem > than it not working at all. > > Warner We've been fighting the NetBSD divergence issue for a lot of years. I think that we have to start accepting that there are places where divergence gives us large net gains. Probably the best goal to keep going forward is to keep the intra-stack APIs as similar as possible so that new modules can be added without much porting work. Scott