Page MenuHomeFreeBSD

libusb: dequeue next transfer on completion to prevent stalls
ClosedPublic

Authored by bapt on Feb 15 2026, 6:20 PM.
Tags
None
Referenced Files
F156946759: D55289.id171938.diff
Sun, May 17, 1:46 PM
Unknown Object (File)
Thu, May 14, 2:54 PM
Unknown Object (File)
Thu, May 7, 9:05 PM
Unknown Object (File)
Fri, May 1, 12:25 PM
Unknown Object (File)
Fri, May 1, 7:13 AM
Unknown Object (File)
Fri, May 1, 7:08 AM
Unknown Object (File)
Thu, Apr 30, 10:33 PM
Unknown Object (File)
Thu, Apr 30, 10:23 PM
Subscribers

Details

Summary

The transfer proxy callbacks (bulk/interrupt, control, isochronous)
only called libusb10_submit_transfer_sub() in the START path to
pipeline the second kernel transfer slot. On completion or error,
no attempt was made to dequeue the next pending transfer from
tr_head onto the now-free slot.

When more than two async transfers were submitted on the same
endpoint, the third (and subsequent) transfers would remain stuck
on tr_head indefinitely, since no completion ever triggered their
submission. This caused a protocol-level deadlock in applications
like adb that submit header + payload + zero-length terminator as
three separate bulk transfers in sequence.

Fix by calling libusb10_submit_transfer_sub() after every
libusb10_complete_transfer() in all three proxy callbacks.

Diff Detail

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