[{"id":1773267,"web_url":"http://patchwork.ozlabs.org/comment/1773267/","msgid":"<1ff85e6b-5ddd-5ed4-b37e-79f4ef235d6c@denx.de>","list_archive_url":null,"date":"2017-09-22T05:03:55","subject":"Re: [U-Boot] [PATCH 09/14] usb: hub: Clear port reset before\n\tusb_hub_port_connect_change()","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> During usb_hub_port_connect_change(), a port reset set feature\n> request is issued to the port, and later a port reset clear feature\n> is done to the same port before the function returns. However at\n> the end of usb_scan_port(), we attempt to clear port reset again\n> on a cached port status change variable, which should not be done.\n> \n> Adjust the call to clear port reset to right before the call to\n> usb_hub_port_connect_change().\n> \n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> ---\n> \n>   common/usb_hub.c | 10 +++++-----\n>   1 file changed, 5 insertions(+), 5 deletions(-)\n> \n> diff --git a/common/usb_hub.c b/common/usb_hub.c\n> index 86a3477..a9d21bc 100644\n> --- a/common/usb_hub.c\n> +++ b/common/usb_hub.c\n> @@ -489,6 +489,11 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)\n>   \t\treturn 0;\n>   \t}\n>   \n> +\tif (portchange & USB_PORT_STAT_C_RESET) {\n> +\t\tdebug(\"port %d reset change\\n\", i + 1);\n> +\t\tusb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);\n> +\t}\n> +\n>   \t/* A new USB device is ready at this point */\n>   \tdebug(\"devnum=%d port=%d: USB dev found\\n\", dev->devnum, i + 1);\n>   \n> @@ -543,11 +548,6 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)\n>   \t\t       hub->overcurrent_count[i]);\n>   \t}\n>   \n> -\tif (portchange & USB_PORT_STAT_C_RESET) {\n> -\t\tdebug(\"port %d reset change\\n\", i + 1);\n> -\t\tusb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);\n> -\t}\n> -\n>   \t/*\n>   \t * We're done with this device, so let's remove this device from\n>   \t * scanning list\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 3xz1br6YhTz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 15:04:08 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 93EABC21F1C; Fri, 22 Sep 2017 05:04:02 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id ED21FC21C62;\n\tFri, 22 Sep 2017 05:03:59 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 13A15C21C62; Fri, 22 Sep 2017 05:03:59 +0000 (UTC)","from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212])\n\tby lists.denx.de (Postfix) with ESMTPS id BD49BC21C29\n\tfor <u-boot@lists.denx.de>; Fri, 22 Sep 2017 05:03:58 +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 8420143AF3;\n\tFri, 22 Sep 2017 07:03:58 +0200 (CEST)","from smtp1.mailbox.org ([80.241.60.240])\n\tby hefe.heinlein-support.de (hefe.heinlein-support.de\n\t[91.198.250.172]) (amavisd-new, port 10030)\n\twith ESMTP id Q_OzQ6Lp-qWh; Fri, 22 Sep 2017 07:03:56 +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-10-git-send-email-bmeng.cn@gmail.com>","From":"Stefan Roese <sr@denx.de>","Message-ID":"<1ff85e6b-5ddd-5ed4-b37e-79f4ef235d6c@denx.de>","Date":"Fri, 22 Sep 2017 07:03:55 +0200","MIME-Version":"1.0","In-Reply-To":"<1505742050-5697-10-git-send-email-bmeng.cn@gmail.com>","Content-Language":"en-US","Subject":"Re: [U-Boot] [PATCH 09/14] usb: hub: Clear port reset before\n\tusb_hub_port_connect_change()","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>"}}]