Module Name: src
Committed By: riastradh
Date: Sun Mar 13 11:28:33 UTC 2022
Modified Files:
src/sys/dev/usb: usbdi.c
Log Message:
usbdi(9): Assert sleepable in usbd_ar_pipe.
Caller of usbd_suspend_pipe or usbd_abort_pipe must be prepared to
sleep for hardware to acknowledge abort and for in-flight callback on
another CPU to complete. Let's catch the mistake early of calling
them in non-sleepable contexts where they might get lucky.
To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 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.233 src/sys/dev/usb/usbdi.c:1.234
--- src/sys/dev/usb/usbdi.c:1.233 Thu Mar 3 06:13:23 2022
+++ src/sys/dev/usb/usbdi.c Sun Mar 13 11:28:33 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.233 2022/03/03 06:13:23 riastradh Exp $ */
+/* $NetBSD: usbdi.c,v 1.234 2022/03/13 11:28:33 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.233 2022/03/03 06:13:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.234 2022/03/13 11:28:33 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1017,6 +1017,7 @@ usbd_ar_pipe(struct usbd_pipe *pipe)
USBHIST_CALLARGS(usbdebug, "pipe = %#jx", (uintptr_t)pipe, 0, 0, 0);
SDT_PROBE1(usb, device, pipe, abort__start, pipe);
+ ASSERT_SLEEPABLE();
KASSERT(mutex_owned(pipe->up_dev->ud_bus->ub_lock));
#ifdef USB_DEBUG