Page MenuHomeFreeBSD

xhci: Do not drop and add bits in xhci
ClosedPublic

Authored by aokblast on May 21 2026, 1:42 PM.
Tags
Referenced Files
Unknown Object (File)
Mon, Jun 15, 1:36 AM
Unknown Object (File)
Mon, Jun 15, 1:04 AM
Unknown Object (File)
Fri, Jun 12, 5:46 PM
Unknown Object (File)
Thu, Jun 11, 12:03 AM
Unknown Object (File)
Wed, Jun 10, 6:12 AM
Unknown Object (File)
Wed, Jun 10, 2:57 AM
Unknown Object (File)
Tue, Jun 9, 5:15 AM
Unknown Object (File)
Fri, Jun 5, 2:13 PM
Subscribers

Details

Summary

Drop and Add bits reset the data toggle for high-speed devices in XHCI.
The toggle bit represents the sequence number in USB 2.0 transfers. However,
a device can only recognize that the toggle bit has been reset while in
the HALT state. As a result, the host and device toggle values may
become mismatched, causing xHCI to reject the packet. This issue was
observed while testing the EZ-USB FX2 device.

The transfer may then return to the original value after a
bi-directional TD because the toggle field is only one bit wide. This
explains the reson that we can only receive packets bi-transfer in some
case. Therefore, we do not reset the toggle bit here.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks fine, is there somewhere in the XHCI specification you can reference for drop bit handling? It'd be good to have a comment there.

Nice catch!

This revision is now accepted and ready to land.May 21 2026, 2:42 PM

This looks fine, is there somewhere in the XHCI specification you can reference for drop bit handling? It'd be good to have a comment there.

Nice catch!

This is a Note in xHCI spec 4.6.8:

The Reset Endpoint Command may only be issued to endpoints in the Halted
state. If software wishes to reset the Data Toggle or Sequence Number of an
endpoint that isn't in the Halted state, then software may issue a Configure
Endpoint Command with the Drop and Add bits set for the target endpoint
that is in the Stopped state or Running but Idle state.

I will attach this in the comment tomorrow, thanks!:)

This looks fine, is there somewhere in the XHCI specification you can reference for drop bit handling? It'd be good to have a comment there.

Nice catch!

This is a Note in xHCI spec 4.6.8:

The Reset Endpoint Command may only be issued to endpoints in the Halted
state. If software wishes to reset the Data Toggle or Sequence Number of an
endpoint that isn't in the Halted state, then software may issue a Configure
Endpoint Command with the Drop and Add bits set for the target endpoint
that is in the Stopped state or Running but Idle state.

I will attach this in the comment tomorrow, thanks!:)

Perfect! Thanks.

This revision was automatically updated to reflect the committed changes.