Commit 27e08a98 authored by Florian Wolter's avatar Florian Wolter Committed by Greg Kroah-Hartman

xhci: Fix race between ep halt and URB cancellation

commit 526867c3 upstream.

The halted state of a endpoint cannot be cleared over CLEAR_HALT from a
user process, because the stopped_td variable was overwritten in the
handle_stopped_endpoint() function. So the xhci_endpoint_reset() function will
refuse the reset and communication with device can not run over this endpoint.
https://bugzilla.kernel.org/show_bug.cgi?id=60699Signed-off-by: default avatarFlorian Wolter <wolly84@web.de>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c9dd3462
...@@ -857,8 +857,12 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci, ...@@ -857,8 +857,12 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
/* Otherwise ring the doorbell(s) to restart queued transfers */ /* Otherwise ring the doorbell(s) to restart queued transfers */
ring_doorbell_for_active_rings(xhci, slot_id, ep_index); ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
} }
/* Clear stopped_td and stopped_trb if endpoint is not halted */
if (!(ep->ep_state & EP_HALTED)) {
ep->stopped_td = NULL; ep->stopped_td = NULL;
ep->stopped_trb = NULL; ep->stopped_trb = NULL;
}
/* /*
* Drop the lock and complete the URBs in the cancelled TD list. * Drop the lock and complete the URBs in the cancelled TD list.
......
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