summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-03-03 05:53:56 +0000
committerriastradh <riastradh@NetBSD.org>2022-03-03 05:53:56 +0000
commit89bee60cb51441c706cf99b74a960509e6711db2 (patch)
tree5abcbc29fd8588e85f63da61eae90c2e5c9cd4a1 /sys/dev
parenta26414d815ad20c304071bbb2d686fbad521719f (diff)
udav(4): Stop asserting !usbnet_isdying.
This can change at any moment; no software lock can prevent the device from being detached. Any test of it is necessarily best-effort just to avoid wasting time later on waiting for requests to fail or time out.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/if_udav.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index ddfa6cf3e74..5d7c87e2b96 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_udav.c,v 1.89 2022/03/03 05:53:33 riastradh Exp $ */
+/* $NetBSD: if_udav.c,v 1.90 2022/03/03 05:53:56 riastradh Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.89 2022/03/03 05:53:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.90 2022/03/03 05:53:56 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -364,7 +364,8 @@ udav_csr_read(struct usbnet *un, int offset, void *buf, int len)
usb_device_request_t req;
usbd_status err;
- KASSERT(!usbnet_isdying(un));
+ if (usbnet_isdying(un))
+ return USBD_IOERROR;
DPRINTFN(0x200,
("%s: %s: enter\n", device_xname(un->un_dev), __func__));
@@ -394,7 +395,8 @@ udav_csr_write(struct usbnet *un, int offset, void *buf, int len)
usb_device_request_t req;
usbd_status err;
- KASSERT(!usbnet_isdying(un));
+ if (usbnet_isdying(un))
+ return USBD_IOERROR;
DPRINTFN(0x200,
("%s: %s: enter\n", device_xname(un->un_dev), __func__));
@@ -438,7 +440,8 @@ udav_csr_write1(struct usbnet *un, int offset, unsigned char ch)
usb_device_request_t req;
usbd_status err;
- KASSERT(!usbnet_isdying(un));
+ if (usbnet_isdying(un))
+ return USBD_IOERROR;
DPRINTFN(0x200,
("%s: %s: enter\n", device_xname(un->un_dev), __func__));