summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAndiry Xu <andiry.xu@amd.com>2010-07-23 00:23:47 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 23:35:41 +0200
commita061a5a0b816de3b4711a2e96764bb3cd8df861e (patch)
treed8440fbedb5761c6a4058f1382ef6bdf46944a24 /drivers/usb
parentUSB: xHCI: Isochronous transfer implementation (diff)
downloadlinux-a061a5a0b816de3b4711a2e96764bb3cd8df861e.tar.xz
linux-a061a5a0b816de3b4711a2e96764bb3cd8df861e.zip
USB: xHCI: allocate bigger ring for isochronous endpoint
Isochronous endpoint needs a bigger size of transfer ring. Isochronous URB consists of multiple packets, each packet needs a isoc td to carry, and there will be multiple trbs inserted to the ring at one time. One segment is too small for isochronous endpoints, and it will result in room_on_ring() check failure and the URB is failed to enqueue. Allocate bigger ring for isochronous endpoint. 8 segments should be enough. This will be replaced with dynamic ring expansion in the future. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci-mem.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 44eeaa016f1b..7d60d1f4debb 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1112,8 +1112,18 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
/* Set up the endpoint ring */
- virt_dev->eps[ep_index].new_ring =
- xhci_ring_alloc(xhci, 1, true, mem_flags);
+ /*
+ * Isochronous endpoint ring needs bigger size because one isoc URB
+ * carries multiple packets and it will insert multiple tds to the
+ * ring.
+ * This should be replaced with dynamic ring resizing in the future.
+ */
+ if (usb_endpoint_xfer_isoc(&ep->desc))
+ virt_dev->eps[ep_index].new_ring =
+ xhci_ring_alloc(xhci, 8, true, mem_flags);
+ else
+ virt_dev->eps[ep_index].new_ring =
+ xhci_ring_alloc(xhci, 1, true, mem_flags);
if (!virt_dev->eps[ep_index].new_ring) {
/* Attempt to use the ring cache */
if (virt_dev->num_rings_cached == 0)