From owner-p4-projects@FreeBSD.ORG Mon Dec 3 19:26:21 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7B3B216A46C; Mon, 3 Dec 2007 19:26:21 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54C116A419 for ; Mon, 3 Dec 2007 19:26:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D853413C46A for ; Mon, 3 Dec 2007 19:26:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lB3JQKjY092396 for ; Mon, 3 Dec 2007 19:26:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lB3JQKwB092393 for perforce@freebsd.org; Mon, 3 Dec 2007 19:26:20 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 3 Dec 2007 19:26:20 GMT Message-Id: <200712031926.lB3JQKwB092393@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 130110 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, 03 Dec 2007 19:26:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=130110 Change 130110 by hselasky@hselasky_laptop001 on 2007/12/03 19:25:51 Optimize OHCI interrupt handler. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ohci.c#46 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ohci.c#46 (text+ko) ==== @@ -1132,7 +1132,8 @@ ohci_interrupt_td(ohci_softc_t *sc, struct thread *ctd) { enum { - FINISH_LIST_MAX = 16}; + FINISH_LIST_MAX = 16, + }; struct usbd_xfer *xlist[FINISH_LIST_MAX + 1]; struct usbd_xfer **xptr = xlist; @@ -1172,8 +1173,6 @@ } #endif - status = 0; - done = le32toh(hcca->hcca_done_head); /* @@ -1189,12 +1188,13 @@ * and HcInterruptStatus should be checked to determine its cause. */ if (done != 0) { + status = 0; + if (done & ~OHCI_DONE_INTRS) { status |= OHCI_WDH; } if (done & OHCI_DONE_INTRS) { status |= OREAD4(sc, OHCI_INTERRUPT_STATUS); - done &= ~OHCI_DONE_INTRS; } hcca->hcca_done_head = 0; @@ -1203,17 +1203,22 @@ status = OREAD4(sc, OHCI_INTERRUPT_STATUS) & ~OHCI_WDH; } - if (status == 0) { /* nothing to be done (PCI shared - * interrupt) */ + status &= ~OHCI_MIE; + if (status == 0) { + /* + * nothing to be done (PCI shared + * interrupt) + */ goto done; } - status &= ~OHCI_MIE; OWRITE4(sc, OHCI_INTERRUPT_STATUS, status); /* Acknowledge */ status &= sc->sc_eintrs; if (status == 0) { goto done; } + + if (status & (OHCI_SO|OHCI_RD|OHCI_UE|OHCI_RHSC)) { #if 0 if (status & OHCI_SO) { /* XXX do what */ @@ -1245,6 +1250,7 @@ usb_callout_reset(&sc->sc_tmo_rhsc, hz, (void *)(void *)ohci_rhsc_enable, sc); } + } status &= ~(OHCI_RHSC | OHCI_WDH | OHCI_SO); if (status != 0) { /* Block unprocessed interrupts. XXX */