From: Bin Meng Date: Thu, 20 Jul 2017 07:12:35 +0800 Subject: [U-Boot] [PATCH v3 12/13] usb: xhci: Set 'Error Count' to 0 for isoch endpoints In-Reply-To: <1500505956-31846-1-git-send-email-bmeng.cn@gmail.com> References: <1500505956-31846-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1500505956-31846-13-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Per xHCI spec, 'Error Count' should be set to 0 for isoch endpoints. Signed-off-by: Bin Meng --- Changes in v3: None drivers/usb/host/xhci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index b039ab0..3508004 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -512,6 +512,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; @@ -589,9 +590,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; -- 2.9.2