XHCI: Handle fragmented transfers failing to submit the next fragment.

Previously they would just get "lost" and never signal completion.
(Considering how rare fragmented transfers are, this may not fix
any real problems.)
This commit is contained in:
Augustin Cavalier 2022-02-24 21:05:54 -05:00
parent 6711786ccc
commit 7c97a7846f

View File

@ -2986,13 +2986,16 @@ XHCI::FinishTransfers()
FreeDescriptor(td);
// this transfer may still have data left
bool finished = true;
transfer->AdvanceByFragment(actualLength);
if (completionCode == COMP_SUCCESS
&& transfer->FragmentLength() > 0) {
TRACE("still %" B_PRIuSIZE " bytes left on transfer\n",
transfer->FragmentLength());
SubmitTransfer(transfer);
} else {
callbackStatus = SubmitTransfer(transfer);
finished = (callbackStatus != B_OK);
}
if (finished) {
// The actualLength was already handled in AdvanceByFragment.
transfer->Finished(callbackStatus, 0);
delete transfer;