summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-03-03 06:13:35 +0000
committerriastradh <riastradh@NetBSD.org>2022-03-03 06:13:35 +0000
commitcbb405fb7c46b4531d84df2ee29136d754698ad1 (patch)
tree73021b0ea42eab20fe8341f44d8620b19d8f229f /sys/dev/usb
parent775cb7babe553055624e35b41af6201378f6c6b4 (diff)
usbdi(9): Suspend control pipe on detach.
The device is gone so control transfers won't complete anyway. This obviates the need to wait for usbd_do_request to time out. Seems like maybe we should make _all_ xfers fail with USBD_CANCELLED when the device is detached, but there's no list of pipes we can just walk down to suspend them, so we'd have to find another way to do so. For now, we'll just keep having drivers suspend/abort pipes other than the control pipe.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usb_subr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 6cbc09ab516..e8e886abfce 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.269 2021/11/06 06:44:42 skrll Exp $ */
+/* $NetBSD: usb_subr.c,v 1.270 2022/03/03 06:13:35 riastradh Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.269 2021/11/06 06:44:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.270 2022/03/03 06:13:35 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -1872,6 +1872,7 @@ usb_disconnect_port(struct usbd_port *up, device_t parent, int flags)
return 0;
}
+ usbd_suspend_pipe(dev->ud_pipe0);
if (dev->ud_subdevlen > 0) {
DPRINTFN(3, "disconnect subdevs", 0, 0, 0, 0);
for (i = 0; i < dev->ud_subdevlen; i++) {