Revert "xhci: Avoid infinite loop when sg urb requires too many trbs"
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 31 Jan 2014 19:51:59 +0000 (11:51 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 7 Feb 2014 22:30:02 +0000 (14:30 -0800)
This reverts commit d6c9ea9069af684358efedcaf2f2f687f51c58ee.

We are ripping out commit 35773dac5f862cb1c82ea151eba3e2f6de51ec3e "usb:
xhci: Link TRB must not occur within a USB payload burst" because it's a
hack that caused regressions in the usb-storage and userspace USB
drivers that use usbfs and libusb.  This commit attempted to fix the
issues with that patch.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org # 3.12
drivers/usb/host/xhci-ring.c

index 909b32a4412f7bf465cd607fe94d818de7db469f..0272450a16670337c714336daf32bc85248ea54f 100644 (file)
@@ -3002,7 +3002,7 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
                        if (num_trbs >= TRBS_PER_SEGMENT) {
                                xhci_err(xhci, "Too many fragments %d, max %d\n",
                                                num_trbs, TRBS_PER_SEGMENT - 1);
-                               return -EINVAL;
+                               return -ENOMEM;
                        }
 
                        nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) |