u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Marek Vasut <marex@denx.de>,
	Christian Hewitt <christianshewitt@gmail.com>,
	Lukasz Majewski <lukma@denx.de>
Cc: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
	u-boot-amlogic@groups.io
Subject: Re: [PATCH v2 2/2] mach-meson: g12a: reset usb controller in reset_misc()
Date: Tue, 11 Oct 2022 19:57:10 +0200	[thread overview]
Message-ID: <2fa3ba46-7a63-1a95-1961-9a1268aff709@linaro.org> (raw)
In-Reply-To: <87czay2u7p.fsf@baylibre.com>

On 11/10/2022 18:36, Mattijs Korpershoek wrote:
> On Tue, Oct 11, 2022 at 17:39, Marek Vasut <marex@denx.de> wrote:
> 
>> 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.
> 
> Yes, thank you for picking 1/2
> 
> Neil, do you want me to look into converting the meson arch which uses
> DWC2 to DM?
> I'm not sure I'm confident to do these changes properly but I'm willing
> to give it a try.
> If you plan to do it yourself, fine by me. I'll respin 2/2 after that.

Sure, give a try, if you don't manage I can help!


Neil

  reply	other threads:[~2022-10-11 17:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07  9:38 [PATCH v2 0/2] fastboot/mach-meson: release usb_gadget on reboot commands Mattijs Korpershoek
2022-10-07  9:38 ` [PATCH v2 1/2] usb: gadget: fastboot: detach usb " Mattijs Korpershoek
2022-10-10 16:08   ` Marek Vasut
2022-10-07  9:38 ` [PATCH v2 2/2] mach-meson: g12a: reset usb controller in reset_misc() Mattijs Korpershoek
2022-10-10 16:09   ` Marek Vasut
2022-10-10 16:22     ` Neil Armstrong
2022-10-10 17:16       ` Marek Vasut
2022-10-11  7:12         ` neil.armstrong
2022-10-11 15:39           ` Marek Vasut
2022-10-11 16:36             ` Mattijs Korpershoek
2022-10-11 17:57               ` neil.armstrong [this message]
2022-11-23 15:45                 ` Mattijs Korpershoek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2fa3ba46-7a63-1a95-1961-9a1268aff709@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=christianshewitt@gmail.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=sjg@chromium.org \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).