Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb usbdi(9): Fix timeout after non-racy xfer resubm...



details:   https://anonhg.NetBSD.org/src/rev/7d6db2b08274
branches:  trunk
changeset: 369909:7d6db2b08274
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Sep 07 10:41:34 2022 +0000

description:
usbdi(9): Fix timeout after non-racy xfer resubmission.

Previously we would never clear ux_timeout_set if an xfer timedout,
so resubmission of the same xfer later would fail to schedule a
callout.

diffstat:

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

diffs (34 lines):

diff -r 8c65c19a219a -r 7d6db2b08274 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Wed Sep 07 06:53:03 2022 +0000
+++ b/sys/dev/usb/usbdi.c       Wed Sep 07 10:41:34 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.243 2022/08/20 11:32:20 riastradh Exp $    */
+/*     $NetBSD: usbdi.c,v 1.244 2022/09/07 10:41:34 riastradh 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.243 2022/08/20 11:32:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.244 2022/09/07 10:41:34 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1683,6 +1683,15 @@
        KASSERT(xfer->ux_timeout_set);
 
        /*
+        * After this point, no further timeout probing will happen for
+        * the current incarnation of the timeout, so make the next
+        * usbd_xfer_schedule_timout schedule a new callout.
+        * usbd_xfer_probe_timeout has already processed any reset.
+        */
+       KASSERT(!xfer->ux_timeout_reset);
+       xfer->ux_timeout_set = false;
+
+       /*
         * Neither callout nor task may be pending; they execute
         * alternately in lock step.
         */



Home | Main Index | Thread Index | Old Index