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
F170790495: D55289.id171960.diff
Sun, Sep 6, 3:48 PM
F170769988: D55289.id171960.diff
Sun, Sep 6, 1:05 PM
Unknown Object (File)
Sun, Sep 6, 1:30 AM
Unknown Object (File)
Sat, Sep 5, 1:18 PM
Unknown Object (File)
Thu, Sep 3, 10:03 PM
Unknown Object (File)
Thu, Sep 3, 6:37 PM
Unknown Object (File)
Thu, Sep 3, 6:37 PM
Unknown Object (File)
Thu, Sep 3, 5:52 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