Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD17FC433F5 for ; Mon, 10 Oct 2022 17:16:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 83C9084E35; Mon, 10 Oct 2022 19:16:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1665422174; bh=Fpy0R+UbQMK70hEwP91WBawnBjhurWxuCUIVWGjttSQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ek7qIXC+mpToMrLCDLS2SpBdlYxdMAA5KZTs4marYAioNCcIrmq9RRLd+Dq4cLJd1 tMEYgBcwUcVFEVMJax1KoX2DKRmw70YDCco6HGwV0P9/c4kmifMOvCkR7sZlcTODKi Q9MQ3y8eAdc5yco/+Hc7FKfxcOPU2nt4J2QdvAFeYoujauQGJp+Qo3EuVpEohRXeke C9cBzJpbjzTLPVqf0E3t7TMnYnqagaBiyp0JE6c37/ARbLJH8jHKp917t9E4HOoCIN 5CIRfotXKDZuSlA2nCcgoBH8ptgML2gPn5Xvpw4nejwJnL6rBBnwJJG3IDfFUFdjxz 2Fns8HgwKYMQw== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1CD628496D; Mon, 10 Oct 2022 19:16:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1665422172; bh=Fpy0R+UbQMK70hEwP91WBawnBjhurWxuCUIVWGjttSQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UaIHK8WtEk0Acn05/2JIx8icBHOEPABZNJq9pJiqV/r+68Jhu1mgQLSu2aY44fpEO wVH+xQZAOg4HYfhDZMeodX5eWq/qSYchrMWyf/ZQi/NorPkKV7HR1bc7z3gJs4cQSx k+rwCRr4YLnhO2rT9FnJElKthWT9t37Owlckg/S+gYBeESj/PwwCb7IaJSYySMjf5V DqeFc+KCFEUaefdRIQssXlna1BEMwTH8pG9oxB1B/GOfRL3ofcfD1WHQQDJx1ksoLV p96YKmClk5Mvo/EvK2KTpcnCCO8F0KbdAmAXvXC8cjbGXkaK+uYqWescRLuPSRy2lG NmDY0sTRDc3Jw== Message-ID: <8c083cfa-4d15-e71c-ba67-8077b282fd96@denx.de> Date: Mon, 10 Oct 2022 19:16:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v2 2/2] mach-meson: g12a: reset usb controller in reset_misc() Content-Language: en-US To: neil.armstrong@linaro.org, Mattijs Korpershoek , Christian Hewitt , Lukasz Majewski Cc: u-boot@lists.denx.de, Simon Glass , u-boot-amlogic@groups.io References: <20220728-reset-usb-controller-v2-0-ef7657ce78b1@baylibre.com> <20220728-reset-usb-controller-v2-2-ef7657ce78b1@baylibre.com> <503f0753-e3be-6e86-5973-2843f5267f1c@denx.de> From: Marek Vasut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 10/10/22 18:22, Neil Armstrong wrote: > Hi, Hi, > On 10/10/2022 18:09, Marek Vasut wrote: >> On 10/7/22 11:38, Mattijs Korpershoek wrote: >>> On some g12a boards like the VIM3L and the SEI610, with some >>> USB cables/hosts, there is a long (5s) delay before >>> between "fastboot reboot" and the host detecting a USB reset. >>> >>> This breaks tools relying on "fastboot reboot fastboot" which assume >>> that 1s after the command send, the board should disconnect on usb. >>> >>> To reproduce, enable fastboot in U-Boot console: >>> => fastboot usb 0 >>> >>> Then, on the host, run: >>>    # echo "running fastboot reboot bootloader" > /dev/kmsg && >>> fastboot reboot bootloader >>>    Rebooting into bootloader                          OKAY [  0.003s] >>>    Finished. Total time: 3.033s >>> >>>    [54074.251551] running fastboot reboot bootloader >>>    ... there is a delay of 5s before we detect a disconnection ... >>>    [54079.041238] usb 1-7.4: USB disconnect, device number 72 >>>    [54079.239625] usb 1-7.4: new high-speed USB device number 73 >>> using xhci_hcd >>>    [54079.359103] usb 1-7.4: New USB device found, idVendor=1b8e, >>> idProduct=fada, bcdDevice= 2.27 >>>    [54079.359110] usb 1-7.4: New USB device strings: Mfr=1, >>> Product=2, SerialNumber=3 >>>    [54079.359112] usb 1-7.4: Product: USB download gadget >>>    [54079.359114] usb 1-7.4: Manufacturer: U-Boot >>>    [54079.359116] usb 1-7.4: SerialNumber: C8631470CC41 >>> >>> Note: this does not happen when we use the RST button on the board. >>> >>> To fix this, re-implement a platform reset which calls >>> board_usb_cleanup() before resetting the board. >> >> Shouldn't that call happen somewhere in drivers/usb/ .remove() >> callback instead ? > > No since dwc2 isn't DM yet, handling is done in arch/arm/mac-meson > board_usb_*() for now Seems DWC2 is DM: $ git grep U_BOOT_DRIVER drivers/usb/ | grep dwc2 drivers/usb/gadget/dwc2_udc_otg.c:U_BOOT_DRIVER(dwc2_udc_otg) = { drivers/usb/host/dwc2.c:U_BOOT_DRIVER(usb_dwc2) = {