]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/host/xhci-ring.c
Merge branch 'for-3.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc...
[~andy/linux] / drivers / usb / host / xhci-ring.c
index d1498c03c4cbfba27dfab25173a6b41d0c9ac54d..cc1485bfed385dc7df6b51a7de70500e453776ef 100644 (file)
@@ -1081,8 +1081,13 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
                complete(&xhci->addr_dev);
                break;
        case TRB_TYPE(TRB_DISABLE_SLOT):
-               if (xhci->devs[slot_id])
+               if (xhci->devs[slot_id]) {
+                       if (xhci->quirks & XHCI_EP_LIMIT_QUIRK)
+                               /* Delete default control endpoint resources */
+                               xhci_free_device_endpoint_resources(xhci,
+                                               xhci->devs[slot_id], true);
                        xhci_free_virt_device(xhci, slot_id);
+               }
                break;
        case TRB_TYPE(TRB_CONFIG_EP):
                virt_dev = xhci->devs[slot_id];
@@ -2061,6 +2066,16 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                if (!event_seg) {
                        if (!ep->skip ||
                            !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) {
+                               /* Some host controllers give a spurious
+                                * successful event after a short transfer.
+                                * Ignore it.
+                                */
+                               if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) && 
+                                               ep_ring->last_td_was_short) {
+                                       ep_ring->last_td_was_short = false;
+                                       ret = 0;
+                                       goto cleanup;
+                               }
                                /* HC is busted, give up! */
                                xhci_err(xhci,
                                        "ERROR Transfer event TRB DMA ptr not "
@@ -2071,6 +2086,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                        ret = skip_isoc_td(xhci, td, event, ep, &status);
                        goto cleanup;
                }
+               if (trb_comp_code == COMP_SHORT_TX)
+                       ep_ring->last_td_was_short = true;
+               else
+                       ep_ring->last_td_was_short = false;
 
                if (ep->skip) {
                        xhci_dbg(xhci, "Found td. Clear skip flag.\n");