Module Name:    src
Committed By:   riastradh
Date:           Wed Sep  7 10:41:34 UTC 2022

Modified Files:
        src/sys/dev/usb: usbdi.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/dev/usb/usbdi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.243 src/sys/dev/usb/usbdi.c:1.244
--- src/sys/dev/usb/usbdi.c:1.243	Sat Aug 20 11:32:20 2022
+++ src/sys/dev/usb/usbdi.c	Wed Sep  7 10:41:34 2022
@@ -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 @@ usbd_xfer_probe_timeout(struct usbd_xfer
 	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.
 	 */

Reply via email to