aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/host/xhci-ring.c8
-rw-r--r--drivers/usb/host/xhci.c6
-rw-r--r--drivers/usb/host/xhci.h2
3 files changed, 6 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 5f609325ec7b..e692e769c50c 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -716,9 +716,7 @@ remove_finished_td:
716 ring_doorbell_for_active_rings(xhci, slot_id, ep_index); 716 ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
717 } 717 }
718 718
719 /* Clear stopped_td if endpoint is not halted */ 719 ep->stopped_td = NULL;
720 if (!(ep->ep_state & EP_HALTED))
721 ep->stopped_td = NULL;
722 720
723 /* 721 /*
724 * Drop the lock and complete the URBs in the cancelled TD list. 722 * 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,
1732 return; 1730 return;
1733 1731
1734 ep->ep_state |= EP_HALTED; 1732 ep->ep_state |= EP_HALTED;
1735 ep->stopped_td = td;
1736 ep->stopped_stream = stream_id; 1733 ep->stopped_stream = stream_id;
1737 1734
1738 xhci_queue_reset_ep(xhci, command, slot_id, ep_index); 1735 xhci_queue_reset_ep(xhci, command, slot_id, ep_index);
1739 xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index); 1736 xhci_cleanup_stalled_ring(xhci, ep_index, td);
1740 1737
1741 ep->stopped_td = NULL;
1742 ep->stopped_stream = 0; 1738 ep->stopped_stream = 0;
1743 1739
1744 xhci_ring_cmd_db(xhci); 1740 xhci_ring_cmd_db(xhci);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 0ea7e12d4765..5be1bff9b4eb 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2912,10 +2912,11 @@ static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci,
2912} 2912}
2913 2913
2914void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, 2914void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
2915 struct usb_device *udev, unsigned int ep_index) 2915 unsigned int ep_index, struct xhci_td *td)
2916{ 2916{
2917 struct xhci_dequeue_state deq_state; 2917 struct xhci_dequeue_state deq_state;
2918 struct xhci_virt_ep *ep; 2918 struct xhci_virt_ep *ep;
2919 struct usb_device *udev = td->urb->dev;
2919 2920
2920 xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, 2921 xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
2921 "Cleaning up stalled endpoint ring"); 2922 "Cleaning up stalled endpoint ring");
@@ -2924,8 +2925,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
2924 * or it will attempt to resend it on the next doorbell ring. 2925 * or it will attempt to resend it on the next doorbell ring.
2925 */ 2926 */
2926 xhci_find_new_dequeue_state(xhci, udev->slot_id, 2927 xhci_find_new_dequeue_state(xhci, udev->slot_id,
2927 ep_index, ep->stopped_stream, ep->stopped_td, 2928 ep_index, ep->stopped_stream, td, &deq_state);
2928 &deq_state);
2929 2929
2930 if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg) 2930 if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg)
2931 return; 2931 return;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index d745715a1e2f..053c9ead4f65 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1825,7 +1825,7 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
1825 unsigned int stream_id, 1825 unsigned int stream_id,
1826 struct xhci_dequeue_state *deq_state); 1826 struct xhci_dequeue_state *deq_state);
1827void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, 1827void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
1828 struct usb_device *udev, unsigned int ep_index); 1828 unsigned int ep_index, struct xhci_td *td);
1829void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci, 1829void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci,
1830 unsigned int slot_id, unsigned int ep_index, 1830 unsigned int slot_id, unsigned int ep_index,
1831 struct xhci_dequeue_state *deq_state); 1831 struct xhci_dequeue_state *deq_state);