Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb for both usbd_transfer() and usbd_ar_pipe() be s...



details:   https://anonhg.NetBSD.org/src/rev/05d134f04e14
branches:  trunk
changeset: 935899:05d134f04e14
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 13 05:43:38 2020 +0000

description:
for both usbd_transfer() and usbd_ar_pipe() be sure to reset the
xfer ux_state to XFER_BUSY when removing from the queue.

seems to fix an occasional panic i was seeing on pinebook and
pinebookpro lately with axen(4).

from riastradh@.

XXX: pullup-9.

diffstat:

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

diffs (38 lines):

diff -r bfdf2ea84bb8 -r 05d134f04e14 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Mon Jul 13 05:40:25 2020 +0000
+++ b/sys/dev/usb/usbdi.c       Mon Jul 13 05:43:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.202 2020/05/19 18:32:35 jakllsch Exp $     */
+/*     $NetBSD: usbdi.c,v 1.203 2020/07/13 05:43:38 mrg Exp $  */
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.202 2020/05/19 18:32:35 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.203 2020/07/13 05:43:38 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -400,6 +400,9 @@
                    err, 0, 0, 0);
                usbd_lock_pipe(pipe);
                SDT_PROBE1(usb, device, xfer, preabort,  xfer);
+#ifdef DIAGNOSTIC
+               xfer->ux_state = XFER_BUSY;
+#endif
                SIMPLEQ_REMOVE_HEAD(&pipe->up_queue, ux_next);
                if (pipe->up_serialise)
                        usbd_start_next(pipe);
@@ -965,6 +968,9 @@
                    (uintptr_t)pipe->up_methods, 0);
                if (xfer->ux_status == USBD_NOT_STARTED) {
                        SDT_PROBE1(usb, device, xfer, preabort,  xfer);
+#ifdef DIAGNOSTIC
+                       xfer->ux_state = XFER_BUSY;
+#endif
                        SIMPLEQ_REMOVE_HEAD(&pipe->up_queue, ux_next);
                } else {
                        /* Make the HC abort it (and invoke the callback). */



Home | Main Index | Thread Index | Old Index