All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Zixun LI <admin@hifiphile.com>
Cc: Lukasz Majewski <lukma@denx.de>, Marek Vasut <marex@denx.de>,
	Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH] usb: gadget: ether: Handle gadget driver registration in start and stop
Date: Wed, 07 Aug 2024 08:34:35 +0200	[thread overview]
Message-ID: <87msloon7o.fsf@baylibre.com> (raw)
In-Reply-To: <CA+GyqeaD26fE9Ks+KP7X+Bok2gF8VE_hgeE2Qfiub8X=REO4EA@mail.gmail.com>

Hi Zixun,

On mar., août 06, 2024 at 22:28, Zixun LI <admin@hifiphile.com> wrote:

> Hi Mattijs,
>
> On Tue, Aug 6, 2024 at 4:00 PM Mattijs Korpershoek
> <mkorpershoek@baylibre.com> wrote:
>>
>> I'd like to test this on my end as well. Could you please give some
>> details on how this has been tested?
>>
>> A sequence of U-Boot commands would be helpful, for example.
>
> My tests are done on a custom ATMEL SAM9G25 board powered
> by USB Gadget port.
>
> Gadget is enabled in the DT:
> &usb2 {
> status = "okay";
> };
>
> usb_ether enabled in board late init:
> int board_late_init(void)
> {
> #ifdef CONFIG_USB_ETHER
> usb_ether_init();
> #endif
> return 0;
> }
>
> Without this patch the host will try to enumerate the USB device once
>  U-Boot is loaded and result in the error I mentioned.

Thank you for the details. I could reproduce the issue on Khadas VIM3
board and I could also test that your patch fixes the issue.

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

>
> With this patch USB is connected only when ethernet command, like dhcp
> is run, then disconnect when it's finished:
> usb 1-1: new high-speed USB device number 91 using xhci_hcd
> usb 1-1: New USB device found, idVendor=0000, idProduct=0000, bcdDevice= 3.17
> usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> usb 1-1: Product: Ethernet Gadget
> usb 1-1: Manufacturer: U-Boot
> cdc_ether 1-1:1.0 usb0: register 'cdc_ether' at usb-0000:04:00.3-1,
> CDC Ethernet Device, de:ad:be:ef:00:00
> cdc_ether 1-1:1.0 enp4s0f3u1: renamed from usb0
> gadget0: port 1(enp4s0f3u1) entered blocking state
> gadget0: port 1(enp4s0f3u1) entered disabled state
> cdc_ether 1-1:1.0 enp4s0f3u1: entered allmulticast mode
> cdc_ether 1-1:1.0 enp4s0f3u1: entered promiscuous mode
> gadget0: port 1(enp4s0f3u1) entered blocking state
> gadget0: port 1(enp4s0f3u1) entered forwarding state
> usb 1-1: USB disconnect, device number 91

  reply	other threads:[~2024-08-07  6:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26  8:31 [PATCH] usb: gadget: ether: Handle gadget driver registration in start and stop Zixun LI
2024-08-06 14:00 ` Mattijs Korpershoek
2024-08-06 20:28   ` Zixun LI
2024-08-07  6:34     ` Mattijs Korpershoek [this message]
2024-08-07  6:38 ` Mattijs Korpershoek
2024-08-20 16:11   ` Mattijs Korpershoek
2024-08-20 17:11     ` Caleb Connolly
2024-08-20 17:12       ` Marek Vasut
2024-08-21 12:34         ` 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=87msloon7o.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=admin@hifiphile.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=trini@konsulko.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.