summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-03-03 06:12:49 +0000
committerriastradh <riastradh@NetBSD.org>2022-03-03 06:12:49 +0000
commitbb51cff8fbd3f90329b39ffdfa3feddb64671422 (patch)
treea85508a45344174de0fb47e4741e5d3a5e9d99f8 /sys/dev/usb
parent537b4545516e7f729dd810f72bded01808e567d1 (diff)
usb: Assert hci doesn't synchronously complete async xfers.
The xfer callback must not be invoked synchronously, because it might need to take a lock that the caller holds. However, the hci might return failure to the caller, meaning the xfer callback will not be invoked at all.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usbdi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 82637b88826..e40b874266e 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.231 2022/03/03 06:12:11 riastradh Exp $ */
+/* $NetBSD: usbdi.c,v 1.232 2022/03/03 06:12:49 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.231 2022/03/03 06:12:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.232 2022/03/03 06:12:49 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -452,8 +452,8 @@ usbd_transfer(struct usbd_xfer *xfer)
if (!(flags & USBD_SYNCHRONOUS)) {
USBHIST_LOG(usbdebug, "<- done xfer %#jx, not sync (err %jd)",
(uintptr_t)xfer, err, 0, 0);
- if (err != USBD_IN_PROGRESS) /* XXX Possible? */
- SDT_PROBE2(usb, device, xfer, done, xfer, err);
+ KASSERTMSG(err != USBD_NORMAL_COMPLETION,
+ "asynchronous xfer %p completed synchronously", xfer);
return err;
}