Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/dev/usb Pull up following revision(s) (requested by s...



details:   https://anonhg.NetBSD.org/src/rev/0e7010b117e3
branches:  netbsd-6
changeset: 776510:0e7010b117e3
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Dec 14 19:26:39 2013 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #990):
        sys/dev/usb/ehci.c: revision 1.221
In ehci_check_qh_intr don't treat a short control transfer as done if the
status phase is still inflight.  Let the hardware complete it.
PR/48358: Repeated low-speed USB control transfers returning short data
          fail on EHCI
PR/46696: uhub disables port where USB keyboard attached

diffstat:

 sys/dev/usb/ehci.c |  25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r c7c4c82bbdec -r 0e7010b117e3 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Mon Dec 09 20:25:28 2013 +0000
+++ b/sys/dev/usb/ehci.c        Sat Dec 14 19:26:39 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.183.2.1 2013/09/26 01:51:47 riz Exp $ */
+/*     $NetBSD: ehci.c,v 1.183.2.2 2013/12/14 19:26:39 bouyer Exp $ */
 
 /*
  * Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.183.2.1 2013/09/26 01:51:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.183.2.2 2013/12/14 19:26:39 bouyer Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -784,9 +784,26 @@
                        /* Any kind of error makes the xfer done. */
                        if (status & EHCI_QTD_HALTED)
                                goto done;
-                       /* We want short packets, and it is short: it's done */
-                       if (EHCI_QTD_GET_BYTES(status) != 0)
+                       /* Handle short packets */
+                       if (EHCI_QTD_GET_BYTES(status) != 0) {
+                               usbd_pipe_handle pipe = ex->xfer.pipe;
+                               usb_endpoint_descriptor_t *ed =
+                                   pipe->endpoint->edesc;
+                               uint8_t xt = UE_GET_XFERTYPE(ed->bmAttributes);
+
+                               /*
+                                * If we get here for a control transfer then
+                                * we need to let the hardware complete the
+                                * status phase.  That is, we're not done
+                                * quite yet.
+                                *
+                                * Otherwise, we're done.
+                                */
+                               if (xt == UE_CONTROL) {
+                                       break;
+                               }
                                goto done;
+                       }
                }
                DPRINTFN(12, ("ehci_check_intr: ex=%p std=%p still active\n",
                              ex, ex->sqtdstart));



Home | Main Index | Thread Index | Old Index