{"id":814928,"url":"http://patchwork.ozlabs.org/api/patches/814928/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1505742050-5697-13-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-13-git-send-email-bmeng.cn@gmail.com>","list_archive_url":null,"date":"2017-09-18T13:40:48","name":"[U-Boot,12/14] usb: xhci: Program max burst size for endpoint","commit_ref":"fa483b2c750f6ebdb5946f46b217aa3f9a449531","pull_url":null,"state":"accepted","archived":false,"hash":"857c0dc27c19e4e7142fbb5430afff16c5aa4fb9","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-13-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/814928/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814928/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=\"E1GAXb3O\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwnHj4SjMz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 23:42:25 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 6DD18C21F3E; Mon, 18 Sep 2017 13:39:33 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E0131C21F14;\n\tMon, 18 Sep 2017 13:37:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 056F9C21F3A; Mon, 18 Sep 2017 13:36:50 +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 99FEEC21F02\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 13:36:46 +0000 (UTC)","by mail-io0-f196.google.com with SMTP id n69so1095047ioi.3\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 06:36:46 -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.44\n\t(version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 18 Sep 2017 06:36:44 -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\t:mime-version:content-transfer-encoding;\n\tbh=okAdEGd64w6KtG/rcUE1VyCfrUuI69mAJOky4sgPJ8c=;\n\tb=E1GAXb3Oxe/tZEthmzdirzeCoG8bzDWRI+3rneSrfuhJu5NdGOATSJlSLd6VlPAI4V\n\tsXUL0QSUwd+0AA/LZUhP5ksutsNgeuh5cHUOLm/nQkvXQ+G573/ny2MOmE8pNJwqMYZp\n\tMy0qyq0PKGWIALaKtTCzxL7DkRXfg5Kb8+FGsh60D/Ienunlyr3DvqG6kRg1j1aPzdOY\n\tvgVfSRjEPKbWusuBLxI3Nx8KeYLoOfFCTpKg6MGvNCvSPHWOb2DpNWVZrfUpmdYN4fKR\n\tqGyRHvmhGneRWUNKIC83Yx4Tvaw8HlmUXm4wOzsQ2eDoCLKGndEV/PTQ4m3Mbd4F9B0U\n\t8csA==","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:mime-version:content-transfer-encoding;\n\tbh=okAdEGd64w6KtG/rcUE1VyCfrUuI69mAJOky4sgPJ8c=;\n\tb=J+VXP7A/kuyBHcnZvO86bjUwHMyw7PIkByudxbwbsEUm8ngv0bSfxSPTQKmEd0evXd\n\tlRMc8116gudj5J/dU43E0ZDQr8sSmg4byG9rqxiHpYf2cOzQcvqLR2WgEI5H6c19Fyoo\n\tqF82F7T37It1/9554M2V8H11mQUpZqqSuU6DyDtIslx3UGFks86gUdq4M07dihGQ2LBR\n\tGOE+Bltfgdgh49KIT5YF1PnrR1jcTKut5TCMQ4OiyBh2xduWCb+3isXoSEpuzPgO8n3x\n\t5vvn+eVcgs85ykl9vnMhZF4bKQ/GCKURa5mkxWSs8XjilDHnXiY8fpLqmcaoo9MWKprX\n\tRDMg==","X-Gm-Message-State":"AHPjjUjqBNQ48RLY6ola/kZw8lrHSrc+hefSL7bszhdwHyfqoit72URM\n\tU49PD0uASdftILVy","X-Google-Smtp-Source":"AOwi7QCbdOi6DpdIvh0MNtk/hnoR2I0g/nCbJupRgO8wPSQhyNef/1pyIzDBoOdEHiq10xniajk6Lg==","X-Received":"by 10.107.175.148 with SMTP id p20mr18361744ioo.32.1505741805579;\n\tMon, 18 Sep 2017 06:36:45 -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:48 -0700","Message-Id":"<1505742050-5697-13-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>","MIME-Version":"1.0","Cc":"Stefan Roese <sr@denx.de>","Subject":"[U-Boot] [PATCH 12/14] usb: xhci: Program max burst size for\n\tendpoint","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-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":"The 'Max Burst Size' indicates to the xHC the maximum number of\nconsecutive USB transactions that should be executed per scheduling\nopportunity. This is a “zero-based” value, where 0 to 15 represents\nburst sizes of 1 to 16, but at present this is always set to zero.\nLet's program the required value according to real needs.\n\nSigned-off-by: Bin Meng <bmeng.cn@gmail.com>\n---\n\n drivers/usb/host/xhci.c | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)","diff":"diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c\nindex 8aed428..dfb188d 100644\n--- a/drivers/usb/host/xhci.c\n+++ b/drivers/usb/host/xhci.c\n@@ -395,6 +395,22 @@ static u32 xhci_get_endpoint_mult(struct usb_device *udev,\n \treturn ss_ep_comp_desc->bmAttributes;\n }\n \n+static u32 xhci_get_endpoint_max_burst(struct usb_device *udev,\n+\tstruct usb_endpoint_descriptor *endpt_desc,\n+\tstruct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)\n+{\n+\t/* Super speed and Plus have max burst in ep companion desc */\n+\tif (udev->speed >= USB_SPEED_SUPER)\n+\t\treturn ss_ep_comp_desc->bMaxBurst;\n+\n+\tif (udev->speed == USB_SPEED_HIGH &&\n+\t    (usb_endpoint_xfer_isoc(endpt_desc) ||\n+\t     usb_endpoint_xfer_int(endpt_desc)))\n+\t\treturn usb_endpoint_maxp_mult(endpt_desc) - 1;\n+\n+\treturn 0;\n+}\n+\n /*\n  * Return the maximum endpoint service interval time (ESIT) payload.\n  * Basically, this is the maxpacket size, multiplied by the burst size\n@@ -493,6 +509,7 @@ static int xhci_set_configuration(struct usb_device *udev)\n \tu32 max_esit_payload;\n \tunsigned int interval;\n \tunsigned int mult;\n+\tunsigned int max_burst;\n \tunsigned int avg_trb_len;\n \n \tout_ctx = virt_dev->out_ctx;\n@@ -545,6 +562,8 @@ static int xhci_set_configuration(struct usb_device *udev)\n \t\tinterval = xhci_get_endpoint_interval(udev, endpt_desc);\n \t\tmult = xhci_get_endpoint_mult(udev, endpt_desc,\n \t\t\t\t\t      ss_ep_comp_desc);\n+\t\tmax_burst = xhci_get_endpoint_max_burst(udev, endpt_desc,\n+\t\t\t\t\t\t\tss_ep_comp_desc);\n \t\tavg_trb_len = max_esit_payload;\n \n \t\tep_index = xhci_get_ep_index(endpt_desc);\n@@ -570,7 +589,7 @@ static int xhci_set_configuration(struct usb_device *udev)\n \t\t\t(get_unaligned(&endpt_desc->wMaxPacketSize)));\n \n \t\tep_ctx[ep_index]->ep_info2 |=\n-\t\t\tcpu_to_le32(((0 & MAX_BURST_MASK) << MAX_BURST_SHIFT) |\n+\t\t\tcpu_to_le32(MAX_BURST(max_burst) |\n \t\t\t((3 & ERROR_COUNT_MASK) << ERROR_COUNT_SHIFT));\n \n \t\ttrb_64 = (uintptr_t)\n","prefixes":["U-Boot","12/14"]}