diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2014-11-27 18:19:16 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-12-02 16:14:29 -0800 |
commit | d97b4f8d690b9fc0e7dd4f4ff5aaea838254e350 (patch) | |
tree | 31e5cb937bee36a831880baabd0c48ed61971b46 /drivers/usb/host/xhci-ring.c | |
parent | 4801d4ea559440b7d63babdac1b1b43a13ac7562 (diff) | |
download | op-kernel-dev-d97b4f8d690b9fc0e7dd4f4ff5aaea838254e350.zip op-kernel-dev-d97b4f8d690b9fc0e7dd4f4ff5aaea838254e350.tar.gz |
xhci: don't use the same variable for stopped and halted rings current TD
Endpoints halted on errors, and endpoints stopped manually both used
the same ep->stopped_td to store the halted or stopped td. this causes
confusion and possible races.
There is no longer a need to use the ep->stopped_td variable to store
the halted TD. A halted endpoint is handled immediately and we can pass
it to the handling function directly.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5f60932..e692e76 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -716,9 +716,7 @@ remove_finished_td: ring_doorbell_for_active_rings(xhci, slot_id, ep_index); } - /* Clear stopped_td if endpoint is not halted */ - if (!(ep->ep_state & EP_HALTED)) - ep->stopped_td = NULL; + ep->stopped_td = NULL; /* * Drop the lock and complete the URBs in the cancelled TD list. @@ -1732,13 +1730,11 @@ static void xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, return; ep->ep_state |= EP_HALTED; - ep->stopped_td = td; ep->stopped_stream = stream_id; xhci_queue_reset_ep(xhci, command, slot_id, ep_index); - xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index); + xhci_cleanup_stalled_ring(xhci, ep_index, td); - ep->stopped_td = NULL; ep->stopped_stream = 0; xhci_ring_cmd_db(xhci); |