diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2014-01-31 14:52:57 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2014-02-07 17:30:03 -0500 |
commit | 3d4b81eda2211f32886e2978daf6f39885042fc4 (patch) | |
tree | a5eaedd2afe98eebb2268f67640f44530992f707 /drivers/usb | |
parent | 9cf00d91708221ff2d8a11143315f7ebab8d5da8 (diff) |
Revert "usb: xhci: Link TRB must not occur within a USB payload burst"
This reverts commit 35773dac5f862cb1c82ea151eba3e2f6de51ec3e. It's a
hack that caused regressions in the usb-storage and userspace USB
drivers that use usbfs and libusb. Commit 70cabb7d992f "xhci 1.0: Limit
arbitrarily-aligned scatter gather." should fix the issues seen with the
ax88179_178a driver on xHCI 1.0 hosts, without causing regressions.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org # 3.12
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 0272450a1667..0ed64eb68e48 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -2967,58 +2967,8 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, | |||
2967 | } | 2967 | } |
2968 | 2968 | ||
2969 | while (1) { | 2969 | while (1) { |
2970 | if (room_on_ring(xhci, ep_ring, num_trbs)) { | 2970 | if (room_on_ring(xhci, ep_ring, num_trbs)) |
2971 | union xhci_trb *trb = ep_ring->enqueue; | 2971 | break; |
2972 | unsigned int usable = ep_ring->enq_seg->trbs + | ||
2973 | TRBS_PER_SEGMENT - 1 - trb; | ||
2974 | u32 nop_cmd; | ||
2975 | |||
2976 | /* | ||
2977 | * Section 4.11.7.1 TD Fragments states that a link | ||
2978 | * TRB must only occur at the boundary between | ||
2979 | * data bursts (eg 512 bytes for 480M). | ||
2980 | * While it is possible to split a large fragment | ||
2981 | * we don't know the size yet. | ||
2982 | * Simplest solution is to fill the trb before the | ||
2983 | * LINK with nop commands. | ||
2984 | */ | ||
2985 | if (num_trbs == 1 || num_trbs <= usable || usable == 0) | ||
2986 | break; | ||
2987 | |||
2988 | if (ep_ring->type != TYPE_BULK) | ||
2989 | /* | ||
2990 | * While isoc transfers might have a buffer that | ||
2991 | * crosses a 64k boundary it is unlikely. | ||
2992 | * Since we can't add NOPs without generating | ||
2993 | * gaps in the traffic just hope it never | ||
2994 | * happens at the end of the ring. | ||
2995 | * This could be fixed by writing a LINK TRB | ||
2996 | * instead of the first NOP - however the | ||
2997 | * TRB_TYPE_LINK_LE32() calls would all need | ||
2998 | * changing to check the ring length. | ||
2999 | */ | ||
3000 | break; | ||
3001 | |||
3002 | if (num_trbs >= TRBS_PER_SEGMENT) { | ||
3003 | xhci_err(xhci, "Too many fragments %d, max %d\n", | ||
3004 | num_trbs, TRBS_PER_SEGMENT - 1); | ||
3005 | return -ENOMEM; | ||
3006 | } | ||
3007 | |||
3008 | nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) | | ||
3009 | ep_ring->cycle_state); | ||
3010 | ep_ring->num_trbs_free -= usable; | ||
3011 | do { | ||
3012 | trb->generic.field[0] = 0; | ||
3013 | trb->generic.field[1] = 0; | ||
3014 | trb->generic.field[2] = 0; | ||
3015 | trb->generic.field[3] = nop_cmd; | ||
3016 | trb++; | ||
3017 | } while (--usable); | ||
3018 | ep_ring->enqueue = trb; | ||
3019 | if (room_on_ring(xhci, ep_ring, num_trbs)) | ||
3020 | break; | ||
3021 | } | ||
3022 | 2972 | ||
3023 | if (ep_ring == xhci->cmd_ring) { | 2973 | if (ep_ring == xhci->cmd_ring) { |
3024 | xhci_err(xhci, "Do not support expand command ring\n"); | 2974 | xhci_err(xhci, "Do not support expand command ring\n"); |