@@ -2868,10 +2868,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2868
2868
return - ESHUTDOWN ;
2869
2869
}
2870
2870
}
2871
- if (trb_comp_code == COMP_SHORT_PACKET )
2872
- ep_ring -> last_td_was_short = true;
2873
- else
2874
- ep_ring -> last_td_was_short = false;
2875
2871
2876
2872
if (ep -> skip ) {
2877
2873
xhci_dbg (xhci ,
@@ -2880,34 +2876,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2880
2876
ep -> skip = false;
2881
2877
}
2882
2878
2883
- ep_trb = & ep_seg -> trbs [(ep_trb_dma - ep_seg -> dma ) /
2884
- sizeof (* ep_trb )];
2885
-
2886
- trace_xhci_handle_transfer (ep_ring ,
2887
- (struct xhci_generic_trb * ) ep_trb );
2888
-
2889
- /*
2890
- * No-op TRB could trigger interrupts in a case where
2891
- * a URB was killed and a STALL_ERROR happens right
2892
- * after the endpoint ring stopped. Reset the halted
2893
- * endpoint. Otherwise, the endpoint remains stalled
2894
- * indefinitely.
2895
- */
2896
-
2897
- if (trb_is_noop (ep_trb )) {
2898
- if (xhci_halted_host_endpoint (ep_ctx , trb_comp_code ))
2899
- xhci_handle_halted_endpoint (xhci , ep , td , EP_HARD_RESET );
2900
- } else {
2901
- td -> status = status ;
2902
-
2903
- /* update the urb's actual_length and give back to the core */
2904
- if (usb_endpoint_xfer_control (& td -> urb -> ep -> desc ))
2905
- process_ctrl_td (xhci , ep , ep_ring , td , ep_trb , event );
2906
- else if (usb_endpoint_xfer_isoc (& td -> urb -> ep -> desc ))
2907
- process_isoc_td (xhci , ep , ep_ring , td , ep_trb , event );
2908
- else
2909
- process_bulk_intr_td (xhci , ep , ep_ring , td , ep_trb , event );
2910
- }
2911
2879
/*
2912
2880
* If ep->skip is set, it means there are missed tds on the
2913
2881
* endpoint ring need to take care of.
@@ -2916,6 +2884,36 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2916
2884
*/
2917
2885
} while (ep -> skip );
2918
2886
2887
+ if (trb_comp_code == COMP_SHORT_PACKET )
2888
+ ep_ring -> last_td_was_short = true;
2889
+ else
2890
+ ep_ring -> last_td_was_short = false;
2891
+
2892
+ ep_trb = & ep_seg -> trbs [(ep_trb_dma - ep_seg -> dma ) / sizeof (* ep_trb )];
2893
+ trace_xhci_handle_transfer (ep_ring , (struct xhci_generic_trb * ) ep_trb );
2894
+
2895
+ /*
2896
+ * No-op TRB could trigger interrupts in a case where a URB was killed
2897
+ * and a STALL_ERROR happens right after the endpoint ring stopped.
2898
+ * Reset the halted endpoint. Otherwise, the endpoint remains stalled
2899
+ * indefinitely.
2900
+ */
2901
+
2902
+ if (trb_is_noop (ep_trb )) {
2903
+ if (xhci_halted_host_endpoint (ep_ctx , trb_comp_code ))
2904
+ xhci_handle_halted_endpoint (xhci , ep , td , EP_HARD_RESET );
2905
+ } else {
2906
+ td -> status = status ;
2907
+
2908
+ /* update the urb's actual_length and give back to the core */
2909
+ if (usb_endpoint_xfer_control (& td -> urb -> ep -> desc ))
2910
+ process_ctrl_td (xhci , ep , ep_ring , td , ep_trb , event );
2911
+ else if (usb_endpoint_xfer_isoc (& td -> urb -> ep -> desc ))
2912
+ process_isoc_td (xhci , ep , ep_ring , td , ep_trb , event );
2913
+ else
2914
+ process_bulk_intr_td (xhci , ep , ep_ring , td , ep_trb , event );
2915
+ }
2916
+
2919
2917
return 0 ;
2920
2918
2921
2919
err_out :
0 commit comments