Date: Mon, 3 Dec 2007 19:26:20 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 130110 for review Message-ID: <200712031926.lB3JQKwB092393@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712031926.lB3JQKwB092393>