From owner-freebsd-usb@FreeBSD.ORG Sun Oct 1 07:43:48 2006 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60C0E16A403 for ; Sun, 1 Oct 2006 07:43:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe10.swip.net [212.247.155.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E8D343D6A for ; Sun, 1 Oct 2006 07:43:46 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from [193.216.91.127] (HELO [10.0.0.249]) by mailfe10.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 122047035; Sun, 01 Oct 2006 09:43:45 +0200 From: Hans Petter Selasky To: Ulrich Spoerlein Date: Sun, 1 Oct 2006 09:44:03 +0200 User-Agent: KMail/1.7 References: <200609171214.49165.hselasky@c2i.net> <20060930152928.GB1441@roadrunner.q.local> In-Reply-To: <20060930152928.GB1441@roadrunner.q.local> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610010944.04652.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: New UMASS driver available for testing X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2006 07:43:48 -0000 On Saturday 30 September 2006 17:29, Ulrich Spoerlein wrote: > Hans Petter Selasky wrote: > > Hi, > > > > I have finished the conversion of the UMASS driver to my new USB API. If > > you have got a UMASS device laying around, and want to help the USB > > project, please give the new driver a test. > > Well, it's been a time, but I finally got around to benchmarking you new > driver. First of all, a diff of the dmesg from the old against your > driver: > > > > As you can see, performance increased by roughly 10%, but system time > increased about 300% :( > > I hope this info was useful to you and am looking forward to seeing your > reworked USB system hit the tree soon! The extra time used is due to an inline wait loop in the code, to make things simple. You can try the following experimental patch: Edit: /sys/dev/usb2/_ehci.c Lookup the following piece of code: if(((xfer->pipe->methods == &ehci_device_ctrl_methods) || (xfer->pipe->methods == &ehci_device_bulk_methods)) && (sc->sc_doorbell_disable == 0)) { u_int32_t to = 100*1000; /* wait for doorbell ~32us */ EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD); while(EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_IAAD) { if(!to--) { printf("%s: doorbell timeout " "(disabling)\n", __FUNCTION__); sc->sc_doorbell_disable = 1; break; } DELAY(1); } need_delay = 0; } Change it to: if(((xfer->pipe->methods == &ehci_device_ctrl_methods) || (xfer->pipe->methods == &ehci_device_bulk_methods)) && (sc->sc_doorbell_disable == 0)) { u_int32_t to = 100*1000; if (error != 0) { /* simply add an "if"-statement */ /* wait for doorbell ~32us */ EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD); while(EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_IAAD) { if(!to--) { printf("%s: doorbell timeout " "(disabling)\n", __FUNCTION__); sc->sc_doorbell_disable = 1; break; } DELAY(1); } need_delay = 0; } } Then recompile the kernel and try again. Thanks for testing. --HPS