Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb In usbd_transfer deal with errors from the HCD t...



details:   https://anonhg.NetBSD.org/src/rev/160ec9903456
branches:  trunk
changeset: 342456:160ec9903456
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Dec 22 22:26:16 2015 +0000

description:
In usbd_transfer deal with errors from the HCD transfer (and start)
methods properly by removing the failed xfer from the pipe queue.

For example, an Apple keyboard and FS hub with attached ums(4) on
dwctwo(4) (rpo0/rpi model a) needs this fix otherwise probing
usbd_new_device will never complete after first failed attempt to get
the initial device descriptor.

diffstat:

 sys/dev/usb/usbdi.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 9bddd93db067 -r 160ec9903456 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Tue Dec 22 22:19:07 2015 +0000
+++ b/sys/dev/usb/usbdi.c       Tue Dec 22 22:26:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $        */
+/*     $NetBSD: usbdi.c,v 1.168 2015/12/22 22:26:16 skrll Exp $        */
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.168 2015/12/22 22:26:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -323,6 +323,15 @@
                        bus->methods->freem(bus, &xfer->dmabuf);
                        xfer->rqflags &= ~URQ_AUTO_DMABUF;
                }
+               /*
+                * The transfer made it onto the pipe queue, but didn't get
+                * accepted by the HCD for some reason.  It needs removing
+                * from the pipe queue.
+                */
+               usbd_lock_pipe(pipe);
+               SIMPLEQ_REMOVE_HEAD(&pipe->queue, next);
+               usbd_start_next(pipe);
+               usbd_unlock_pipe(pipe);
        }
 
        if (!(flags & USBD_SYNCHRONOUS)) {



Home | Main Index | Thread Index | Old Index