Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/efc7cfdff85c
branches:  netbsd-9
changeset: 963905:efc7cfdff85c
user:      martin <martin%NetBSD.org@localhost>
date:      Mon May 25 15:31:45 2020 +0000

description:
Pull up following revision(s) (requested by jakllsch in ticket #921):

        sys/dev/usb/xhci.c: revision 1.129

xhci(4): only usbd_xfer_trycomplete() if certain to usb_transfer_complete()

Previously we'd cancel the timeout after the data stage of control xfers, and
then hope that the status stage would eventually interrupt.

diffstat:

 sys/dev/usb/xhci.c |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (60 lines):

diff -r f868ba68b1e2 -r efc7cfdff85c sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Mon May 25 15:26:05 2020 +0000
+++ b/sys/dev/usb/xhci.c        Mon May 25 15:31:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.107.2.5 2020/03/01 12:35:16 martin Exp $    */
+/*     $NetBSD: xhci.c,v 1.107.2.6 2020/05/25 15:31:45 martin Exp $    */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.5 2020/03/01 12:35:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.6 2020/05/25 15:31:45 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1969,13 +1969,6 @@
                return;
        }
 
-       /*
-        * Try to claim this xfer for completion.  If it has already
-        * completed or aborted, drop it on the floor.
-        */
-       if (!usbd_xfer_trycomplete(xfer))
-               return;
-
        /* 4.11.5.2 Event Data TRB */
        if ((trb_3 & XHCI_TRB_3_ED_BIT) != 0) {
                DPRINTFN(14, "transfer Event Data: 0x%016jx 0x%08jx"
@@ -2031,6 +2024,13 @@
                DPRINTFN(1, "ERR %ju slot %ju dci %ju", trbcode, slot, dci, 0);
                xr->is_halted = true;
                /*
+                * Try to claim this xfer for completion.  If it has already
+                * completed or aborted, drop it on the floor.
+                */
+               if (!usbd_xfer_trycomplete(xfer))
+                       return;
+
+               /*
                 * Stalled endpoints can be recoverd by issuing
                 * command TRB TYPE_RESET_EP on xHCI instead of
                 * issuing request CLEAR_FEATURE UF_ENDPOINT_HALT
@@ -2055,6 +2055,13 @@
                break;
        }
 
+       /*
+        * Try to claim this xfer for completion.  If it has already
+        * completed or aborted, drop it on the floor.
+        */
+       if (!usbd_xfer_trycomplete(xfer))
+               return;
+
        /* Set the status.  */
        xfer->ux_status = err;
 



Home | Main Index | Thread Index | Old Index