diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2014-02-21 14:29:02 -0800 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2014-03-04 15:40:45 -0800 |
commit | 21d0e51bfb290349adc02fa8fec716d77f53df51 (patch) | |
tree | 721fb06c523273535fa1fedab52b2c61a0f9fccc /drivers/usb | |
parent | 50e8725e7c429701e530439013f9681e1fa36b5d (diff) | |
download | linux-21d0e51bfb290349adc02fa8fec716d77f53df51.tar.gz linux-21d0e51bfb290349adc02fa8fec716d77f53df51.tar.bz2 linux-21d0e51bfb290349adc02fa8fec716d77f53df51.zip |
xhci: Kill streams URBs when the host dies.
If the host controller stops responding to commands, we need to kill all
the URBs that were queued to all endpoints. The current code would only
kill URBs that had been queued to the endpoint rings. ep->ring is set
to NULL if streams has been enabled for the endpoint, which means URBs
submitted with a non-zero stream_id would never get killed. Fix this.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 58cbc06ecdf9..5f926bea5ab1 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -922,13 +922,27 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci, struct xhci_ring *ring; ep = &xhci->devs[slot_id]->eps[ep_index]; - ring = ep->ring; - if (!ring) - return; - xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, - "Killing URBs for slot ID %u, ep index %u", - slot_id, ep_index); - xhci_kill_ring_urbs(xhci, ring); + if ((ep->ep_state & EP_HAS_STREAMS) || + (ep->ep_state & EP_GETTING_NO_STREAMS)) { + int stream_id; + + for (stream_id = 0; stream_id < ep->stream_info->num_streams; + stream_id++) { + xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, + "Killing URBs for slot ID %u, ep index %u, stream %u", + slot_id, ep_index, stream_id + 1); + xhci_kill_ring_urbs(xhci, + ep->stream_info->stream_rings[stream_id]); + } + } else { + ring = ep->ring; + if (!ring) + return; + xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, + "Killing URBs for slot ID %u, ep index %u", + slot_id, ep_index); + xhci_kill_ring_urbs(xhci, ring); + } while (!list_empty(&ep->cancelled_td_list)) { cur_td = list_first_entry(&ep->cancelled_td_list, struct xhci_td, cancelled_td_list); |