Commit d2cd8e2e authored by Mathias Nyman's avatar Mathias Nyman Committed by Jiri Slaby

USB: xhci: don't start a halted endpoint before its new dequeue is set

commit c3492dbf upstream.

A halted endpoint ring must first be reset, then move the ring
dequeue pointer past the problematic TRB. If we start the ring too
early after reset, but before moving the dequeue pointer we
will end up executing the same problematic TRB again.

As we always issue a set transfer dequeue command after a reset
endpoint command we can skip starting endpoint rings at reset endpoint
command completion.

Without this fix we end up trying to handle the same faulty TD for
contol endpoints. causing timeout, and failing testusb ctrl_out write
tests.

Fixes: e9df17eb (USB: xhci: Correct assumptions about number of rings per endpoint.)
Tested-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 4a6c782d
...@@ -1206,9 +1206,8 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci, ...@@ -1206,9 +1206,8 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci,
false); false);
xhci_ring_cmd_db(xhci); xhci_ring_cmd_db(xhci);
} else { } else {
/* Clear our internal halted state and restart the ring(s) */ /* Clear our internal halted state */
xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED; xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED;
ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment