aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorShengYi Hung <aokblast@FreeBSD.org>2026-05-21 12:49:42 +0000
committerShengYi Hung <aokblast@FreeBSD.org>2026-05-22 07:41:07 +0000
commit28d85db46b484589e2ee74cf4b270db066821de1 (patch)
tree8e779101635c320b3f54560173428b104e435e6d /sys
parent0c85df0065146516d5bacfc80d52d9ee6b33b96d (diff)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/controller/xhci.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 3dad0985b39d..b522c5fdc5a3 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -3898,10 +3898,8 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
*/
switch (xhci_get_endpoint_state(udev, epno)) {
case XHCI_EPCTX_0_EPSTATE_DISABLED:
- drop = 0;
- break;
case XHCI_EPCTX_0_EPSTATE_STOPPED:
- drop = 1;
+ drop = 0;
break;
case XHCI_EPCTX_0_EPSTATE_HALTED:
err = xhci_cmd_reset_ep(sc, 0, epno, index);
@@ -3910,9 +3908,15 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
DPRINTF("Could not reset endpoint %u\n", epno);
break;
default:
- drop = 1;
+ /*
+ * xHCI spec 4.6.8:
+ * The Drop and Add operation resets the toggle bit, which can
+ * cause a toggle mismatch between the device and host. As a
+ * result, xHCI may refuse to receive or process the packet.
+ */
err = xhci_cmd_stop_ep(sc, 0, epno, index);
- if (err != 0)
+ drop = (err != 0);
+ if (drop)
DPRINTF("Could not stop endpoint %u\n", epno);
break;
}