diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-03-13 11:29:01 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-03-13 11:29:01 +0000 |
| commit | 92feef340d80674016bccb6a127f8100b74acea1 (patch) | |
| tree | 44f2c09403ff72d5c40a2126ba561976456b2368 /sys/dev | |
| parent | fd6bcfb67366b341462d5ceaa82b8f85796573a5 (diff) | |
usb: Clarify contract of usbd_xfer_trycomplete.
No functional change. This rule has always been in place since
usbd_xfer_trycomplete was created, just wasn't clearly articulated
anywhere.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/usbdi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 9583d1ef08c..d2054e2e96e 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.235 2022/03/13 11:28:42 riastradh Exp $ */ +/* $NetBSD: usbdi.c,v 1.236 2022/03/13 11:29:01 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.235 2022/03/13 11:28:42 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.236 2022/03/13 11:29:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1506,7 +1506,11 @@ usbd_get_string0(struct usbd_device *dev, int si, char *buf, int unicode) * in a host controller interrupt handler. * * Caller must either hold the bus lock or have the bus in polling - * mode. + * mode. If this succeeds, caller must proceed to call + * usb_complete_transfer under the bus lock or with polling + * enabled -- must not release and reacquire the bus lock in the + * meantime. Failing to heed this rule may lead to catastrophe + * with abort or timeout. */ bool usbd_xfer_trycomplete(struct usbd_xfer *xfer) |
