From owner-freebsd-current@FreeBSD.ORG Tue Jul 20 01:53:52 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 B60F216A4CE; Tue, 20 Jul 2004 01:53:52 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A6B343D2F; Tue, 20 Jul 2004 01:53:50 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i6K1oqnE036786; Mon, 19 Jul 2004 19:50:52 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jul 2004 19:50:56 -0600 (MDT) Message-Id: <20040719.195056.35662742.imp@bsdimp.com> To: iedowse@maths.tcd.ie From: "M. Warner Losh" In-Reply-To: <200407200045.aa99979@salmon.maths.tcd.ie> References: <20040719.170132.52458790.imp@bsdimp.com> <200407200045.aa99979@salmon.maths.tcd.ie> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: mycroft@NetBSD.org cc: scottl@freebsd.org 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: Tue, 20 Jul 2004 01:53:52 -0000 In message: <200407200045.aa99979@salmon.maths.tcd.ie> Ian Dowse writes: : In message <20040719.170132.52458790.imp@bsdimp.com>, "M. Warner Losh" writes: : >In message: <200407191950.aa12733@salmon.maths.tcd.ie> : > Ian Dowse writes: : >: 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. : > : >I'm going to start merging in some of these changes, if you don't : >mind. : : If you have the time that would be great! FYI, here is a rough : summary of the changes in no particular order: : : o Beginnings of interrupt pipe support for EHCI (very little done) cool. : o Support for unloading the usb driver (leaks some memory) : o Support for removing cardbus USB controllers (also leaks memory) These are my biggest goals of the moment. : o Avoid most (but not all) uses of contigmalloc and data buffer : copies by using bus_dmamap_load() and a new `struct usb_dma_mapping'. : A few places marked `XXX' need to be checked for crossing DMA : segment boundaries. This is probably the most important change, : as it makes USB work much more reliably on low memory machines. This would be nice. : o Attempt to follow the correct procedure for synchronising with : the BIOS via SMM to take over control of the EHCI controller. : This may fix problems when the BIOS is configured to emulate : legacy devices, but is untested on any affected machines. Docs on how to do this? I've not seen this info... : o Try to make transfers reusable from the completion callback (some : related changes went into NetBSD recently, but I haven't checked : the overlap). I saw that. : There are probably a few other changes in there too - let me know if : you find any stuff that doesn't make sense. OK. Will do. I think we need to look at radically updating the way we do compatibility between the different systems that the usb code runs on. But that's a good way to freak people out by saying such things in public :-) Warner