git: 8a46f021c240 - main - Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled.
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Aug 18 09:43:17 UTC 2021
The branch main has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=8a46f021c2408c82375a1f5127efb7ac6b78596e
commit 8a46f021c2408c82375a1f5127efb7ac6b78596e
Author: Hans Petter Selasky <hselasky at FreeBSD.org>
AuthorDate: 2021-08-18 09:41:49 +0000
Commit: Hans Petter Selasky <hselasky at FreeBSD.org>
CommitDate: 2021-08-18 09:42:37 +0000
Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled.
MFC after: 1 week
Sponsored by: NVIDIA Networking
---
sys/dev/usb/serial/uftdi.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c
index 9dc00e82253f..eaf4a9e78086 100644
--- a/sys/dev/usb/serial/uftdi.c
+++ b/sys/dev/usb/serial/uftdi.c
@@ -1212,14 +1212,9 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error)
DPRINTFN(3, "\n");
switch (USB_GET_STATE(xfer)) {
- default: /* Error */
- if (error != USB_ERR_CANCELLED) {
- /* try to clear stall first */
- usbd_xfer_set_stall(xfer);
- }
- /* FALLTHROUGH */
case USB_ST_SETUP:
case USB_ST_TRANSFERRED:
+tr_setup:
if (usbd_xfer_get_and_clr_zlp(xfer))
break;
@@ -1257,6 +1252,13 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error)
usbd_transfer_submit(xfer);
}
break;
+ default: /* Error */
+ if (error != USB_ERR_CANCELLED) {
+ /* try to clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ break;
}
}
More information about the dev-commits-src-all
mailing list