diff options
| author | skrll <skrll@NetBSD.org> | 2015-12-22 22:26:16 +0000 |
|---|---|---|
| committer | skrll <skrll@NetBSD.org> | 2015-12-22 22:26:16 +0000 |
| commit | d396ff055dbdc3a8017d75cf3f9b417e8dd58d46 (patch) | |
| tree | c6b1baadf635d916302d7654cd43701df46dc1f4 /sys/dev | |
| parent | ad803b5c1802ea96dd776fc24815cb685e5a23f2 (diff) | |
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 (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/usbdi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index a7d4c68c82d..3d50996e68e 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -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 @@ usbd_transfer(usbd_xfer_handle xfer) 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)) { |
