
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