public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Tom Rini <trini@konsulko.com>
Cc: Marek Vasut <marex@denx.de>,
	u-boot@lists.denx.de, Kevin Hilman <khilman@baylibre.com>,
	Lukasz Majewski <lukma@denx.de>, Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH v4 1/4] cmd: bind: Add unbind command with driver filter
Date: Fri, 4 Aug 2023 19:01:46 +0200	[thread overview]
Message-ID: <20230804190146.2595e241@xps-13> (raw)
In-Reply-To: <20230804161515.GR3630934@bill-the-cat>

Hi Tom,

> > > >>> Well, what's needed / is it possible to get to the point where we don't
> > > >>> _need_ to call bind/unbind for each of these cases? Is there something
> > > >>> we're supposed to be setting in the DT that we aren't?    
> > > >>
> > > >> You do need to unbind the ethernet before using fastboot, always, with the 'unbind ethernet 0', you dont need the peripheral unbind/rebind part, so it should behave like before.    
> > > > 
> > > > And for my own understanding, why don't we need to bind a fastboot
> > > > gadget?    
> > > 
> > > The fastboot command does that internally .  
> > 
> > This is not visible with dm tree and I did not find how to bind the
> > fastboot gadget manually.
> > 
> > This makes the CLI clearly uneven and the internal code badly different
> > between gadgets/commands. Why can't we have them both
> > autoloaded/unloaded like before? I think I missed something which
> > explains the rationale behind this series.  
> 
> They aren't both auto-loaded currently. We have a legacy call,
> usb_ether_init(), in a few cases, so that gadget mode ethernet starts.
> But this leads to the ref counting problems you encountered and
> re-posted the rejected series for.

Ok, thanks for the additional details.

I don't understand why fastboot autoloads the correct gadget driver if
there is none bound, while all network commands just fail to do that if
we don't make the usb_ether_init() call manually.

I also don't understand why I need to unbind the ethernet gadget but I
cannot bind the fastboot gadget.

My underlying question is: can we have a single approach for all
drivers, or is it too complex today? Could it be possible, when we
perform these autoloads, to look up the registered gadget and
potentially unbind the one already in place before?

Thanks,
Miquèl

  reply	other threads:[~2023-08-04 17:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 12:46 [PATCH v4 1/4] cmd: bind: Add unbind command with driver filter Marek Vasut
2023-08-02 12:46 ` [PATCH v4 2/4] usb: gadget: ether: Inline functions used once Marek Vasut
2023-08-02 12:46 ` [PATCH v4 3/4] usb: gadget: ether: Move probe function above driver structure Marek Vasut
2023-08-02 12:46 ` [PATCH v4 4/4] usb: gadget: ether: Handle gadget driver registration in probe and remove Marek Vasut
2023-08-02 21:31 ` [PATCH v4 1/4] cmd: bind: Add unbind command with driver filter Simon Glass
2023-08-02 22:04   ` Marek Vasut
2023-08-04  7:00 ` Miquel Raynal
2023-08-04 14:42   ` Marek Vasut
2023-08-04 15:01     ` Tom Rini
2023-08-04 15:05       ` Marek Vasut
2023-08-04 15:12         ` Miquel Raynal
2023-08-04 15:40           ` Marek Vasut
2023-08-04 16:00             ` Miquel Raynal
2023-08-04 16:15               ` Tom Rini
2023-08-04 17:01                 ` Miquel Raynal [this message]
2023-08-04 17:18                   ` Marek Vasut
2023-08-04 17:20                   ` Tom Rini
2023-08-04 18:01                     ` Miquel Raynal
2023-08-04 18:51                       ` Tom Rini
2023-08-04 19:38                         ` Miquel Raynal
2023-08-04 16:37               ` Tom Rini
2023-08-04 17:04                 ` Miquel Raynal
2023-08-04 17:19                   ` Marek Vasut
2023-08-04 17:23                   ` Tom Rini
2023-08-04 17:24             ` Miquel Raynal
2023-08-04 17:31               ` Marek Vasut
2023-08-04 17:46                 ` Miquel Raynal
2023-08-04 17:54                   ` Marek Vasut

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=20230804190146.2595e241@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=khilman@baylibre.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=sjg@chromium.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox