{"id":814935,"url":"http://patchwork.ozlabs.org/api/patches/814935/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1505742050-5697-15-git-send-email-bmeng.cn@gmail.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505742050-5697-15-git-send-email-bmeng.cn@gmail.com>","list_archive_url":null,"date":"2017-09-18T13:40:50","name":"[U-Boot,14/14] usb: xhci: Set 'Average TRB Length' to 8 for control endpoints","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"ec913fad56c655a85161131e393265c58b2aaf8f","submitter":{"id":64981,"url":"http://patchwork.ozlabs.org/api/people/64981/?format=json","name":"Bin Meng","email":"bmeng.cn@gmail.com"},"delegate":{"id":1699,"url":"http://patchwork.ozlabs.org/api/users/1699/?format=json","username":"marex","first_name":"Marek","last_name":"Vasut","email":"marek.vasut@gmail.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1505742050-5697-15-git-send-email-bmeng.cn@gmail.com/mbox/","series":[{"id":3647,"url":"http://patchwork.ozlabs.org/api/series/3647/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=3647","date":"2017-09-18T13:40:36","name":"usb: xhci: Add interrupt transfer support and full speed device support","version":1,"mbox":"http://patchwork.ozlabs.org/series/3647/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814935/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814935/checks/","tags":{},"related":[],"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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"urwoiOfx\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwnKT51KSz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 23:43:57 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 667AEC21F47; Mon, 18 Sep 2017 13:40:18 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 95E05C21E21;\n\tMon, 18 Sep 2017 13:37:52 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 71970C21E21; Mon, 18 Sep 2017 13:36:53 +0000 (UTC)","from mail-io0-f196.google.com (mail-io0-f196.google.com\n\t[209.85.223.196])\n\tby lists.denx.de (Postfix) with ESMTPS id C3F17C21F45\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 13:36:49 +0000 (UTC)","by mail-io0-f196.google.com with SMTP id 93so1090073iol.4\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 06:36:49 -0700 (PDT)","from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com.\n\t[147.11.156.139]) by smtp.gmail.com with ESMTPSA id\n\t193sm2528740ion.83.2017.09.18.06.36.47\n\t(version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 18 Sep 2017 06:36:47 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=+ufq+Ot2f/lW5hCozhbMDTbZvoR606P3tM5z3pSw/VE=;\n\tb=urwoiOfxsZW2dcXpUqmTmv5DugmgLz57HknXSHtlxC/8/LRwyCDriW6WuTk59I4O2K\n\tslH9GQqni6WuuOP3lt+JpkqjsWs1IttDU1ZmzlUKDYS0xhEHPIx2gKlK7OYOwivtRAZ+\n\tkRjhMmzQTnbDzTzjpwVrYeQhhY2gxR5qbvyHaOtVs7+SMao20uvR3nDXCmggbsGDTWfB\n\t8xqrWS5Zl6VPvUMVAPYJvxE2iLKPuhdWKLfnSnb/yCB+KfmmqcdBuVhCVGSmZhpfHBMG\n\te2QW00Pj1EWxw78GkEnFkE6L1luAX/xIshiMj2/e0tOO2fAQQ8xNoWhuanVwwTH9Tgxj\n\thbxg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=+ufq+Ot2f/lW5hCozhbMDTbZvoR606P3tM5z3pSw/VE=;\n\tb=dv4eqggx5ppPsZFn62H0kQ7dVt58ykwsF7HDG755bBre0tMHSz4DtCzrSB8WqXSrt+\n\trpeNaWe3cxmeJKPAx569wweBmA0HRpSiGpROk2ZWyHkK4KwlgrJWPQamTOWhb7ndnj8l\n\tLyOvodVJ6U2FD6hSnZiXT/Lw0Cg0i8bNWxc7J5y1KzAO8fqv7P8Wvl+0WS4sMg4VM8ip\n\tgxD3nk6Vv01O8RV5RLlJ9rC3ucHCJ37SwkmWnPNOPKnDpp/W8ziQhkuMDXU8yNc7IXH2\n\taW2/MJooS24XycsWhEOuBgzdUvALmvyobri/z3X3zxiFV86NRaLZpaxKB15YnAZAnWvS\n\ti4sQ==","X-Gm-Message-State":"AHPjjUhl6mVXvBgozfACzhIZ5KlFeJhEXWcSxhGsou+YV07PstZbQBmK\n\tVhklv7DgJoZNRsej","X-Google-Smtp-Source":"AOwi7QB2Q6WhW8lpzldhgBrsUW/wQync9UUdfh841Fy1cYdlqMSIWNjw6kbM0MuvNy6Bwj1tojUhEw==","X-Received":"by 10.107.191.3 with SMTP id p3mr9897021iof.177.1505741808718;\n\tMon, 18 Sep 2017 06:36:48 -0700 (PDT)","From":"Bin Meng <bmeng.cn@gmail.com>","To":"Marek Vasut <marex@denx.de>, U-Boot Mailing List <u-boot@lists.denx.de>","Date":"Mon, 18 Sep 2017 06:40:50 -0700","Message-Id":"<1505742050-5697-15-git-send-email-bmeng.cn@gmail.com>","X-Mailer":"git-send-email 1.7.9.5","In-Reply-To":"<1505742050-5697-1-git-send-email-bmeng.cn@gmail.com>","References":"<1505742050-5697-1-git-send-email-bmeng.cn@gmail.com>","Cc":"Stefan Roese <sr@denx.de>","Subject":"[U-Boot] [PATCH 14/14] usb: xhci: Set 'Average TRB Length' to 8 for\n\tcontrol 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>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"Update the codes to conform with xHCI spec chapter 6.2.3.\n\nSigned-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(+)","diff":"diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c\nindex 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));\ndiff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c\nindex 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","prefixes":["U-Boot","14/14"]}