From owner-freebsd-current@FreeBSD.ORG Mon May 24 06:19:55 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 CF0A116A4CE for ; Mon, 24 May 2004 06:19:54 -0700 (PDT) Received: from nwkea-mail-2.sun.com (nwkea-mail-2.sun.com [192.18.42.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D70843D1F for ; Mon, 24 May 2004 06:19:53 -0700 (PDT) (envelope-from Peter.Weiss@Sun.com) Received: from sun-gy.germany ([129.157.128.5]) by nwkea-mail-2.sun.com (8.12.10/8.12.9) with ESMTP id i4ODIttF002593; Mon, 24 May 2004 06:18:55 -0700 (PDT) Received: from Winona.Germany.Sun.COM (winona [129.157.133.118]) i4ODIsBg027241; Mon, 24 May 2004 15:18:54 +0200 (MEST) Received: from Winona.Germany.Sun.COM (localhost [IPv6:::1]) i4ODIsCM021302; Mon, 24 May 2004 15:18:54 +0200 (MEST) Received: (from pw105345@localhost)i4ODIsO9021301; Mon, 24 May 2004 15:18:54 +0200 (MEST) X-Authentication-Warning: winona.Germany.Sun.COM: pw105345 set sender to Peter.Weiss@Sun.com using -f To: Ian Dowse From: Peter.Weiss@Sun.com (Peter Weiss, Sun Microsystems, Germany) Date: Mon, 24 May 2004 15:18:53 +0200 In-Reply-To: <200405232109.aa46210@salmon.maths.tcd.ie> (Ian Dowse's message of "Sun, 23 May 2004 21:09:01 +0100") Message-ID: User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.3 (sparc-sun-solaris2.9) References: <200405232109.aa46210@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: current@freebsd.org Subject: Re: USB patch for better bus_dma and detachment support 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, 24 May 2004 13:19:55 -0000 >>>>> "Ian" == Ian Dowse writes: Ian> In case anybody is interested in testing or helping with this, there's a Ian> patch at Ian> http://people.freebsd.org/~iedowse/usb.diff Ian> that attempts to begin addressing a number of problems with our current Ian> USB code: Ian> o All data buffers were allocated using bus_dma as physically Ian> contiguous memory. All transfers involve a memory copy to/from these Ian> contiguous buffers, and the contiguous memory is never freed. Use of Ian> these buffers is also inefficient, so low-memory systems tend to quickly Ian> run out of usable physical memory. Ian> o USB host controllers cannot be detached, so for example, unplugging a Ian> cardbus USB device will cause a crash. Ian> Neither of these issues is completely solved by the patch, but most I/O Ian> now avoids the need for contiguous buffers by using bus_dmamap_load() on Ian> the virtual buffer, and the system seems to survive the removal of a Ian> cardbus OHCI/EHCI controller, though memory is probably leaked. Ian> [...] Yes, the patch works, but does not fix the hotplugging of my optical usb mouse on my notebook. Unplugging is recognized, but no reaction seen if it's plugged in again Peter -- Peter Weiss / Peter.Weiss@germany.sun.com Sun Microsystems GmbH / Sonnenallee 1, D-85551 Kirchheim-Heimstetten (+49 89) 46008 2947 / mobil 0177/ 60 40 121