Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21d0e51b authored by Sarah Sharp's avatar Sarah Sharp
Browse files

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: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 50e8725e
Loading
Loading
Loading
Loading
+21 −7
Original line number Original line Diff line number Diff line
@@ -922,6 +922,19 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci,
	struct xhci_ring *ring;
	struct xhci_ring *ring;


	ep = &xhci->devs[slot_id]->eps[ep_index];
	ep = &xhci->devs[slot_id]->eps[ep_index];
	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;
		ring = ep->ring;
		if (!ring)
		if (!ring)
			return;
			return;
@@ -929,6 +942,7 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci,
				"Killing URBs for slot ID %u, ep index %u",
				"Killing URBs for slot ID %u, ep index %u",
				slot_id, ep_index);
				slot_id, ep_index);
		xhci_kill_ring_urbs(xhci, ring);
		xhci_kill_ring_urbs(xhci, ring);
	}
	while (!list_empty(&ep->cancelled_td_list)) {
	while (!list_empty(&ep->cancelled_td_list)) {
		cur_td = list_first_entry(&ep->cancelled_td_list,
		cur_td = list_first_entry(&ep->cancelled_td_list,
				struct xhci_td, cancelled_td_list);
				struct xhci_td, cancelled_td_list);