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 7BF6FC433FE for ; Tue, 11 Oct 2022 15:40:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6961684F0B; Tue, 11 Oct 2022 17:40:03 +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=1665502804; bh=orAT/Xp6LRz45zXivWGBVV4NfN7+g3MGQEPIgRaC7vI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=I6vnAytmArUq7ItGDl5zZ/90DRFvxa2vbzVTX7pprScyyeByVq+1CaQPAqAmuzCU+ XoizN7bhBx92pNwQnnDcO12HsbVkN34AnsrxP80FIxoNAFk7OAzxzG12lnOlX6uiXS 8pmPDlMu5BJq+T5z+9ekuknNqWAq7P6Q7HtmzsRiwWYPHXRztccMwY/MBP0ZQI4paF 8yD3YustbiXtZJAGb4E1GnaanU0SuV/xhQzv07pvzmXyuqJBaMRz2HNuCfxQumIK2L Xk3HqKyGt3VClAKys9Th3Umhzwxsfh4R6bIjZfGfhgG5o7Nvu4n2UFE1rwQjClNPLo K71P3U12dIW2Q== 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 12EBA84EFB; Tue, 11 Oct 2022 17:40:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1665502800; bh=orAT/Xp6LRz45zXivWGBVV4NfN7+g3MGQEPIgRaC7vI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jZoA1XdFp+j1APAU/lbYVpd2Bz1GzBVv4pyM97v5CnvkA9H6T1cQ//vFHg20o3w+Z Qnq4nPDi8L2I19g9ajjzGRCypVuBJo/bn0ODuvUn1yvhe3RwhD61v+9Yjq1ccTYYoD xQm3LWaB353LgcqBxr3m3fdKE1tlBtP72VydYpjCk6vZOpK1M9UjouDTmz6BuCkpN2 Zlz3lmADaFW20vmI1utRzUIMmp7persbPy70muIt3u3bST9p7H0D3VTFTZqWZfHD6d 4XNT3mhE21hVu1kfMkqbbLKt9REFtgMM/X6cWXbbnCX9Qz22WvxXvrGbIG22c0cVbh dEYQXgR5OGufw== Message-ID: <6b1237b8-746c-c9aa-4be4-ef323396b2f8@denx.de> Date: Tue, 11 Oct 2022 17:39:59 +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> <8c083cfa-4d15-e71c-ba67-8077b282fd96@denx.de> <938b9439-9014-5ee8-1627-16af508bface@linaro.org> From: Marek Vasut In-Reply-To: <938b9439-9014-5ee8-1627-16af508bface@linaro.org> 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/11/22 09:12, neil.armstrong@linaro.org wrote: > On 10/10/2022 19:16, Marek Vasut wrote: >> 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) = { >> > > My bad, seems I missed the dwc2 otg DM wagon... > > We will need to switch to this now then, thanks, Thanks. I picked 1/2 at least, so you can only focus on 2/2 and send just that.