On 05/09/18(Wed) 09:51, Tom Murphy wrote:
> [...] 
> I physically unplug the phone and the kernel starts generating the xhci0: 
> timeout aborting transfer messages in a loop.

Aah!  So the messages appear *after* you unplugged the device.  That
makes sense.  Does the diff below help?  I just committed the previous
one so make sure you have current sources.

Index: xhci.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/xhci.c,v
retrieving revision 1.88
diff -u -p -r1.88 xhci.c
--- xhci.c      5 Sep 2018 14:03:28 -0000       1.88
+++ xhci.c      5 Sep 2018 14:17:39 -0000
@@ -2055,8 +2055,13 @@ xhci_abort_xfer(struct usbd_xfer *xfer, 
        xp->aborted_xfer = xfer;
 
        /* Stop the endpoint and wait until the hardware says so. */
-       if (xhci_cmd_stop_ep(sc, xp->slot, xp->dci))
+       if (xhci_cmd_stop_ep(sc, xp->slot, xp->dci)) {
                DPRINTF(("%s: error stopping endpoint\n", DEVNAME(sc)));
+               /* Assume the device is gone. */
+               xfer->status = status;
+               usb_transfer_complete(xfer);
+               return;
+       }
 
        /*
         * The transfer was already completed when we stopped the

Reply via email to