[{"id":1773260,"web_url":"http://patchwork.ozlabs.org/comment/1773260/","msgid":"<d6cb9131-876f-3511-3437-ca1569270d1a@denx.de>","list_archive_url":null,"date":"2017-09-22T04:58:40","subject":"Re: [U-Boot] [PATCH 03/14] usb: xhci: Don't assume LS/FS devices\n\tare always behind a HS hub","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> At present xHCI driver assumes LS/FS devices are attached directly\n> to a HS hub. If they are connected to a LS/FS hub, the driver will\n> fail to perform the USB enumeration process on such devices.\n> \n> This is fixed by looking from the device itself all the way up to\n> the HS hub where the TT that serves the device is located.\n> \n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> ---\n> \n>   drivers/usb/host/xhci-mem.c | 18 ++++++++++++++----\n>   1 file changed, 14 insertions(+), 4 deletions(-)\n> \n> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c\n> index d5eab3a..84982a9 100644\n> --- a/drivers/usb/host/xhci-mem.c\n> +++ b/drivers/usb/host/xhci-mem.c\n> @@ -786,12 +786,22 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,\n>   #ifdef CONFIG_DM_USB\n>   \t/* Set up TT fields to support FS/LS devices */\n>   \tif (speed == USB_SPEED_LOW || speed == USB_SPEED_FULL) {\n> -\t\tdev = dev_get_parent_priv(udev->dev);\n> -\t\tif (dev->speed == USB_SPEED_HIGH) {\n> -\t\t\thub = dev_get_uclass_priv(udev->dev);\n> +\t\tstruct udevice *parent = udev->dev;\n> +\n> +\t\tdev = udev;\n> +\t\tdo {\n> +\t\t\tport_num = dev->portnr;\n> +\t\t\tdev = dev_get_parent_priv(parent);\n> +\t\t\tif (usb_hub_is_root_hub(dev->dev))\n> +\t\t\t\tbreak;\n> +\t\t\tparent = dev->dev->parent;\n> +\t\t} while (dev->speed != USB_SPEED_HIGH);\n> +\n> +\t\tif (!usb_hub_is_root_hub(dev->dev)) {\n> +\t\t\thub = dev_get_uclass_priv(dev->dev);\n>   \t\t\tif (hub->tt.multi)\n>   \t\t\t\tslot_ctx->dev_info |= cpu_to_le32(DEV_MTT);\n> -\t\t\tslot_ctx->tt_info |= cpu_to_le32(TT_PORT(udev->portnr));\n> +\t\t\tslot_ctx->tt_info |= cpu_to_le32(TT_PORT(port_num));\n>   \t\t\tslot_ctx->tt_info |= cpu_to_le32(TT_SLOT(dev->slot_id));\n>   \t\t}\n>   \t}\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 3xz1Tp47nhz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 14:58:54 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 509F3C21F07; Fri, 22 Sep 2017 04:58:46 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 19FB0C21C29;\n\tFri, 22 Sep 2017 04:58:44 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 04D40C21C29; Fri, 22 Sep 2017 04:58:42 +0000 (UTC)","from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212])\n\tby lists.denx.de (Postfix) with ESMTPS id AB1F8C21C26\n\tfor <u-boot@lists.denx.de>; Fri, 22 Sep 2017 04:58:42 +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 mx1.mailbox.org (Postfix) with ESMTPS id 8AA9345AC6;\n\tFri, 22 Sep 2017 06:58:42 +0200 (CEST)","from smtp1.mailbox.org ([80.241.60.240])\n\tby spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de\n\t[80.241.56.116]) (amavisd-new, port 10030)\n\twith ESMTP id 6li8m35Y0Du3; Fri, 22 Sep 2017 06:58:40 +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-4-git-send-email-bmeng.cn@gmail.com>","From":"Stefan Roese <sr@denx.de>","Message-ID":"<d6cb9131-876f-3511-3437-ca1569270d1a@denx.de>","Date":"Fri, 22 Sep 2017 06:58:40 +0200","MIME-Version":"1.0","In-Reply-To":"<1505742050-5697-4-git-send-email-bmeng.cn@gmail.com>","Content-Language":"en-US","Subject":"Re: [U-Boot] [PATCH 03/14] usb: xhci: Don't assume LS/FS devices\n\tare always behind a HS hub","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>"}}]