summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-09-18 16:40:49 +0300
committerMarek Vasut <marex@denx.de>2017-10-01 17:32:54 +0300
commitab2b727dc03113fe35d6a9c937911055be3d3990 (patch)
tree4766f95cb7e57de846c93c5d4466122427d9988e /drivers/usb
parentfa483b2c750f6ebdb5946f46b217aa3f9a449531 (diff)
downloadu-boot-ab2b727dc03113fe35d6a9c937911055be3d3990.tar.xz
usb: xhci: Set 'Error Count' to 0 for isoch endpoints
Per xHCI spec, 'Error Count' should be set to 0 for isoch endpoints. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index dfb188d5e4..93737b083c 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -511,6 +511,7 @@ static int xhci_set_configuration(struct usb_device *udev)
unsigned int mult;
unsigned int max_burst;
unsigned int avg_trb_len;
+ unsigned int err_count = 0;
out_ctx = virt_dev->out_ctx;
in_ctx = virt_dev->in_ctx;
@@ -588,9 +589,12 @@ static int xhci_set_configuration(struct usb_device *udev)
cpu_to_le32(MAX_PACKET
(get_unaligned(&endpt_desc->wMaxPacketSize)));
+ /* Allow 3 retries for everything but isoc, set CErr = 3 */
+ if (!usb_endpoint_xfer_isoc(endpt_desc))
+ err_count = 3;
ep_ctx[ep_index]->ep_info2 |=
cpu_to_le32(MAX_BURST(max_burst) |
- ((3 & ERROR_COUNT_MASK) << ERROR_COUNT_SHIFT));
+ ERROR_COUNT(err_count));
trb_64 = (uintptr_t)
virt_dev->eps[ep_index].ring->enqueue;