From owner-p4-projects@FreeBSD.ORG Mon Oct 30 19:52:17 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CCDB016A47B; Mon, 30 Oct 2006 19:52:16 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A267916A40F for ; Mon, 30 Oct 2006 19:52:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E263343D82 for ; Mon, 30 Oct 2006 19:52:15 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9UJqFBT013450 for ; Mon, 30 Oct 2006 19:52:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9UJqFsL013445 for perforce@freebsd.org; Mon, 30 Oct 2006 19:52:15 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 30 Oct 2006 19:52:15 GMT Message-Id: <200610301952.k9UJqFsL013445@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 108774 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2006 19:52:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=108774 Change 108774 by hselasky@hselasky_mini_itx on 2006/10/30 19:51:29 Emphasize why the doorbell is inline. Only wait for the doorbell for non-root transfers. Change a variable from uint32_t to bus_size_t. It should not make any difference, unless 64-bit addressing is used, which is currently not the case. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ehci.c#14 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ehci.c#14 (text+ko) ==== @@ -1966,12 +1966,33 @@ /* remove interrupt info (if any) */ ehci_remove_interrupt_info(xfer); - if(((xfer->pipe->methods == &ehci_device_ctrl_methods) || - (xfer->pipe->methods == &ehci_device_bulk_methods)) && - (sc->sc_doorbell_disable == 0)) - { + if ((xfer->pipe->methods != &ehci_root_ctrl_methods) && + (xfer->pipe->methods != &ehci_root_intr_methods)) { + + 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; + /* + * This implementation does not use the doorbell + * interrupt. The reason is that one gets more + * throughput by waiting for the doorbell inline, + * than by using the doorbell interrupt. A typical + * result reading from an USB mass storage disk: + * + * With doorbell interrupt: 27 seconds for 512MB + * With inline doorbell: 21 seconds for 512MB + * + * Although the inline version causes a slightly + * higher CPU usage, it does not block the system + * in any way, because this USB driver uses its + * own mutex. + * + * --hps + */ + /* wait for doorbell ~32us */ EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD); @@ -1987,10 +2008,13 @@ } DELAY(1); } - need_delay = 0; - } - else - { + + /* acknowledge any doorbell interrupt + * (SiS chipsets require this) + */ + EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_IAA); + + } else { /* wait until the hardware has finished any possible * use of the transfer descriptor and QH * @@ -1999,13 +2023,9 @@ * frame is started */ DELAY(need_delay ? ((3*1000)/(2*8)) : (5)); + } } - /* acknowledge any doorbell interrupt - * (SiS chipsets require this) - */ - EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_IAA); - if(error) { /* next transfer needs to clear stall */ @@ -2516,8 +2536,8 @@ { struct usbd_page_search buf_res; ehci_softc_t *sc = xfer->usb_sc; + bus_size_t page_addr; u_int32_t status; - u_int32_t page_addr; u_int32_t buf_offset; u_int32_t nframes; u_int16_t *plen;