[{"id":1773273,"web_url":"http://patchwork.ozlabs.org/comment/1773273/","msgid":"<7a7e2ed9-05e6-b0c3-0199-7814e38d046c@denx.de>","list_archive_url":null,"date":"2017-09-22T05:13:13","subject":"Re: [U-Boot] [PATCH 14/14] usb: xhci: Set 'Average TRB Length' to 8\n\tfor control endpoints","submitter":{"id":13,"url":"http://patchwork.ozlabs.org/api/people/13/","name":"Stefan Roese","email":"sr@denx.de"},"content":"On 18.09.2017 15:40, Bin Meng wrote:\n> Update the codes to conform with xHCI spec chapter 6.2.3.\n> \n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> \n> ---\n> \n>   drivers/usb/host/xhci-mem.c | 6 ++++++\n>   drivers/usb/host/xhci.c     | 6 ++++++\n>   2 files changed, 12 insertions(+)\n> \n> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c\n> index 84982a9..0582a9b 100644\n> --- a/drivers/usb/host/xhci-mem.c\n> +++ b/drivers/usb/host/xhci-mem.c\n> @@ -850,6 +850,12 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,\n>   \ttrb_64 = (uintptr_t)virt_dev->eps[0].ring->first_seg->trbs;\n>   \tep0_ctx->deq = cpu_to_le64(trb_64 | virt_dev->eps[0].ring->cycle_state);\n>   \n> +\t/*\n> +\t * xHCI spec 6.2.3:\n> +\t * software shall set 'Average TRB Length' to 8 for control endpoints.\n> +\t */\n> +\tep0_ctx->tx_info = cpu_to_le32(EP_AVG_TRB_LENGTH(8));\n> +\n>   \t/* Steps 7 and 8 were done in xhci_alloc_virt_device() */\n>   \n>   \txhci_flush_cache((uintptr_t)ep0_ctx, sizeof(struct xhci_ep_ctx));\n> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c\n> index 93737b0..4673738 100644\n> --- a/drivers/usb/host/xhci.c\n> +++ b/drivers/usb/host/xhci.c\n> @@ -601,6 +601,12 @@ static int xhci_set_configuration(struct usb_device *udev)\n>   \t\tep_ctx[ep_index]->deq = cpu_to_le64(trb_64 |\n>   \t\t\t\tvirt_dev->eps[ep_index].ring->cycle_state);\n>   \n> +\t\t/*\n> +\t\t * xHCI spec 6.2.3:\n> +\t\t * 'Average TRB Length' should be 8 for control endpoints.\n> +\t\t */\n> +\t\tif (usb_endpoint_xfer_control(endpt_desc))\n> +\t\t\tavg_trb_len = 8;\n>   \t\tep_ctx[ep_index]->tx_info =\n>   \t\t\tcpu_to_le32(EP_MAX_ESIT_PAYLOAD_LO(max_esit_payload) |\n>   \t\t\tEP_AVG_TRB_LENGTH(avg_trb_len));\n> \n\nReviewed-by: Stefan Roese <sr@denx.de>\nTested-by: Stefan Roese <sr@denx.de>\n\nThanks,\nStefan","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xz1pn0VnMz9ryr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 15:13:34 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid B6796C21DEF; Fri, 22 Sep 2017 05:13:29 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 0D4FEC21C8F;\n\tFri, 22 Sep 2017 05:13:28 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid E52F0C21C8F; Fri, 22 Sep 2017 05:13:26 +0000 (UTC)","from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215])\n\tby lists.denx.de (Postfix) with ESMTPS id A6D9AC21C29\n\tfor <u-boot@lists.denx.de>; Fri, 22 Sep 2017 05:13:26 +0000 (UTC)","from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx2.mailbox.org (Postfix) with ESMTPS id 86BC74B985;\n\tFri, 22 Sep 2017 07:13:26 +0200 (CEST)","from smtp1.mailbox.org ([80.241.60.240])\n\tby gerste.heinlein-support.de (gerste.heinlein-support.de\n\t[91.198.250.173]) (amavisd-new, port 10030)\n\twith ESMTP id 8U845r8eupDN; Fri, 22 Sep 2017 07:13:14 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW\n\tautolearn=unavailable autolearn_force=no version=3.4.0","X-Virus-Scanned":"amavisd-new at heinlein-support.de","To":"Bin Meng <bmeng.cn@gmail.com>, Marek Vasut <marex@denx.de>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<1505742050-5697-1-git-send-email-bmeng.cn@gmail.com>\n\t<1505742050-5697-15-git-send-email-bmeng.cn@gmail.com>","From":"Stefan Roese <sr@denx.de>","Message-ID":"<7a7e2ed9-05e6-b0c3-0199-7814e38d046c@denx.de>","Date":"Fri, 22 Sep 2017 07:13:13 +0200","MIME-Version":"1.0","In-Reply-To":"<1505742050-5697-15-git-send-email-bmeng.cn@gmail.com>","Content-Language":"en-US","Subject":"Re: [U-Boot] [PATCH 14/14] usb: xhci: Set 'Average TRB Length' to 8\n\tfor control endpoints","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]