On Sat, Aug 21, 2010 at 10:46:22AM -0400, Kenneth R Westerback wrote:
> On Sat, Aug 21, 2010 at 07:43:18AM +0000, Jacob Meuser wrote:
> > returning here without calling usb_transfer_complete() can cause
> > the usbtask thread to sleep forever, which breaks all usb devices
> > that use usb_tasks.
> >
> > --
> > [email protected]
> > SDF Public Access UNIX System - http://sdf.lonestar.org
> >
> > Index: ehci.c
> > ===================================================================
> > RCS file: /cvs/src/sys/dev/usb/ehci.c,v
> > retrieving revision 1.106
> > diff -u -p ehci.c
> > --- ehci.c 26 Nov 2009 12:27:48 -0000 1.106
> > +++ ehci.c 21 Aug 2010 07:20:03 -0000
> > @@ -2215,7 +2215,8 @@ ehci_root_ctrl_start(usbd_xfer_handle xfer)
> > if (v & EHCI_PS_PR) {
> > printf("%s: port reset timeout\n",
> > sc->sc_bus.bdev.dv_xname);
> > - return (USBD_TIMEOUT);
> > + err = USBD_IOERROR;
>
> err = USBD_TIMEOUT?
well, the error is received somewhere else now. I chose IOERROR
because that's what is used if the other steps of this sequence fail.
I suspect something else needs to be done here, probably retrying the
port reset. this needs to be looked at closer, but returning
immediately *will* break all of usb, because the task that started
this will sleep forever in the task thread waiting for a wakeup that
won't happen. maybe the proper thing is to do the wakeup here?
>
> .... Ken
>
> > + goto ret;
> > }
> > if (!(v & EHCI_PS_PE)) {
> > /* Not a high speed device, give up ownership.*/
--
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org