Date: Thu, 24 May 2007 17:54:58 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 120326 for review Message-ID: <200705241754.l4OHswmn004567@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=120326 Change 120326 by hselasky@hselasky_mini_itx on 2007/05/24 17:54:45 Improve starting of isochronous transfers when the isochronous pipe is empty, hence some USB devices does not like when there is excess data per timeslot. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ehci.c#30 edit .. //depot/projects/usb/src/sys/dev/usb/ohci.c#24 edit .. //depot/projects/usb/src/sys/dev/usb/uhci.c#25 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ehci.c#30 (text+ko) ==== @@ -2534,9 +2534,14 @@ buf_offset = (nframes - xfer->pipe->isoc_next) & (EHCI_VIRTUAL_FRAMELIST_COUNT-1); - if (buf_offset < xfer->nframes) { - /* not in use yet, schedule it a few frames ahead */ - /* data underflow */ + if ((LIST_FIRST(&(xfer->pipe->list_head)) == NULL) || + (buf_offset < xfer->nframes)) + { + /* If there is data underflow or the pipe queue is + * empty we schedule the transfer a few frames ahead + * of the current frame position. Else two + * isochronous transfers might overlap. + */ xfer->pipe->isoc_next = (nframes + 3) & (EHCI_VIRTUAL_FRAMELIST_COUNT-1); DPRINTFN(2,("start next=%d\n", xfer->pipe->isoc_next)); @@ -2790,9 +2795,14 @@ buf_offset = (nframes - xfer->pipe->isoc_next) & (EHCI_VIRTUAL_FRAMELIST_COUNT-1); - if (buf_offset < xfer->nframes) { - /* not in use yet, schedule it a few frames ahead */ - /* data underflow */ + if ((LIST_FIRST(&(xfer->pipe->list_head)) == NULL) || + (buf_offset < xfer->nframes)) + { + /* If there is data underflow or the pipe queue is + * empty we schedule the transfer a few frames ahead + * of the current frame position. Else two + * isochronous transfers might overlap. + */ xfer->pipe->isoc_next = (nframes + 3) & (EHCI_VIRTUAL_FRAMELIST_COUNT-1); DPRINTFN(2,("start next=%d\n", xfer->pipe->isoc_next)); ==== //depot/projects/usb/src/sys/dev/usb/ohci.c#24 (text+ko) ==== @@ -1946,16 +1946,15 @@ nframes = le32toh(hw_ptr->hcca.hcca_frame_number); usbd_page_dma_enter(&(sc->sc_hw_page)); - /* check if the frame index is within - * the window where the frames will be - * inserted and if the delay until start - * is too long - */ - if ((((nframes - xfer->pipe->isoc_next) & 0xFFFF) < xfer->nframes) || + if ((LIST_FIRST(&(xfer->pipe->list_head)) == NULL) || + (((nframes - xfer->pipe->isoc_next) & 0xFFFF) < xfer->nframes) || (((xfer->pipe->isoc_next - nframes) & 0xFFFF) >= 128)) { - /* not in use yet, schedule it a few frames ahead */ - /* data underflow */ + /* If there is data underflow or the pipe queue is + * empty we schedule the transfer a few frames ahead + * of the current frame position. Else two + * isochronous transfers might overlap. + */ xfer->pipe->isoc_next = (nframes + 3) & 0xFFFF; DPRINTFN(2,("start next=%d\n", xfer->pipe->isoc_next)); } ==== //depot/projects/usb/src/sys/dev/usb/uhci.c#25 (text+ko) ==== @@ -2048,9 +2048,14 @@ buf_offset = (nframes - xfer->pipe->isoc_next) & (UHCI_VFRAMELIST_COUNT-1); - if (buf_offset < xfer->nframes) { - /* not in use yet, schedule it a few frames ahead */ - /* data underflow */ + if ((LIST_FIRST(&(xfer->pipe->list_head)) == NULL) || + (buf_offset < xfer->nframes)) + { + /* If there is data underflow or the pipe queue is + * empty we schedule the transfer a few frames ahead + * of the current frame position. Else two + * isochronous transfers might overlap. + */ xfer->pipe->isoc_next = (nframes + 3) & (UHCI_VFRAMELIST_COUNT-1); DPRINTFN(2,("start next=%d\n", xfer->pipe->isoc_next)); }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705241754.l4OHswmn004567>
