diff options
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 800f417c7309..70cacbbe7fb9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1733,6 +1733,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
1733 | frame->status = -EOVERFLOW; | 1733 | frame->status = -EOVERFLOW; |
1734 | skip_td = true; | 1734 | skip_td = true; |
1735 | break; | 1735 | break; |
1736 | case COMP_DEV_ERR: | ||
1736 | case COMP_STALL: | 1737 | case COMP_STALL: |
1737 | frame->status = -EPROTO; | 1738 | frame->status = -EPROTO; |
1738 | skip_td = true; | 1739 | skip_td = true; |
@@ -1767,9 +1768,6 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
1767 | } | 1768 | } |
1768 | } | 1769 | } |
1769 | 1770 | ||
1770 | if ((idx == urb_priv->length - 1) && *status == -EINPROGRESS) | ||
1771 | *status = 0; | ||
1772 | |||
1773 | return finish_td(xhci, td, event_trb, event, ep, status, false); | 1771 | return finish_td(xhci, td, event_trb, event, ep, status, false); |
1774 | } | 1772 | } |
1775 | 1773 | ||
@@ -1787,8 +1785,7 @@ static int skip_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
1787 | idx = urb_priv->td_cnt; | 1785 | idx = urb_priv->td_cnt; |
1788 | frame = &td->urb->iso_frame_desc[idx]; | 1786 | frame = &td->urb->iso_frame_desc[idx]; |
1789 | 1787 | ||
1790 | /* The transfer is partly done */ | 1788 | /* The transfer is partly done. */ |
1791 | *status = -EXDEV; | ||
1792 | frame->status = -EXDEV; | 1789 | frame->status = -EXDEV; |
1793 | 1790 | ||
1794 | /* calc actual length */ | 1791 | /* calc actual length */ |
@@ -2016,6 +2013,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
2016 | TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), | 2013 | TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), |
2017 | ep_index); | 2014 | ep_index); |
2018 | goto cleanup; | 2015 | goto cleanup; |
2016 | case COMP_DEV_ERR: | ||
2017 | xhci_warn(xhci, "WARN: detect an incompatible device"); | ||
2018 | status = -EPROTO; | ||
2019 | break; | ||
2019 | case COMP_MISSED_INT: | 2020 | case COMP_MISSED_INT: |
2020 | /* | 2021 | /* |
2021 | * When encounter missed service error, one or more isoc tds | 2022 | * When encounter missed service error, one or more isoc tds |
@@ -2063,6 +2064,20 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
2063 | /* Is this a TRB in the currently executing TD? */ | 2064 | /* Is this a TRB in the currently executing TD? */ |
2064 | event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue, | 2065 | event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue, |
2065 | td->last_trb, event_dma); | 2066 | td->last_trb, event_dma); |
2067 | |||
2068 | /* | ||
2069 | * Skip the Force Stopped Event. The event_trb(event_dma) of FSE | ||
2070 | * is not in the current TD pointed by ep_ring->dequeue because | ||
2071 | * that the hardware dequeue pointer still at the previous TRB | ||
2072 | * of the current TD. The previous TRB maybe a Link TD or the | ||
2073 | * last TRB of the previous TD. The command completion handle | ||
2074 | * will take care the rest. | ||
2075 | */ | ||
2076 | if (!event_seg && trb_comp_code == COMP_STOP_INVAL) { | ||
2077 | ret = 0; | ||
2078 | goto cleanup; | ||
2079 | } | ||
2080 | |||
2066 | if (!event_seg) { | 2081 | if (!event_seg) { |
2067 | if (!ep->skip || | 2082 | if (!ep->skip || |
2068 | !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { | 2083 | !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { |
@@ -2158,6 +2173,11 @@ cleanup: | |||
2158 | urb->transfer_buffer_length, | 2173 | urb->transfer_buffer_length, |
2159 | status); | 2174 | status); |
2160 | spin_unlock(&xhci->lock); | 2175 | spin_unlock(&xhci->lock); |
2176 | /* EHCI, UHCI, and OHCI always unconditionally set the | ||
2177 | * urb->status of an isochronous endpoint to 0. | ||
2178 | */ | ||
2179 | if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) | ||
2180 | status = 0; | ||
2161 | usb_hcd_giveback_urb(bus_to_hcd(urb->dev->bus), urb, status); | 2181 | usb_hcd_giveback_urb(bus_to_hcd(urb->dev->bus), urb, status); |
2162 | spin_lock(&xhci->lock); | 2182 | spin_lock(&xhci->lock); |
2163 | } | 2183 | } |