Hi Mathias,
Do we in this COMP_COMMAND_RING_STOPPED case even need to check if
cmd_dma != (u64)cmd_dequeue_dma, or if command ring stopped on a link TRB?
Could we just move the COMP_COMMAND_RING_STOPPED handling a bit earlier?
if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) {
complete_all(&xhci->cmd_ring_stop_completion);
return;
}
If I remember correctly it should just turn aborted command TRBs into
no-ops,
and restart the command ring
Thanks for reviewing the changes!
Yes, you’re right. As part of restarting the command ring, we just ring
the doorbell.
If we move the event handling without validating the dequeue pointer,
wouldn’t it be a risk if we don’t check what the xHC is holding in its
dequeue pointer? If we are not setting it, it starts from wherever it
stopped. What if the dequeue pointer got corrupted or is not pointing to
any of the TRBs in the command ring?