[PATCH v4 1/4] cmd: bind: Add unbind command with driver filter

Marek Vasut marex at denx.de
Fri Aug 4 19:19:30 CEST 2023


On 8/4/23 19:04, Miquel Raynal wrote:
> Hi Tom,
> 
>>>>>>>>> Cannot find a device with path /ocp/usb at 47400000/usb at 47401000
>>>>>>>>> => unbind /ocp/usb at 47400000/usb at 47401000
>>>>>>>>> => dm tree
>>>>>>>>>      misc          0  [ + ]   ti-musb-wrapper       |   |-- usb at 47400000
>>>>>>>>>      usb           0  [   ]   ti-musb-host          |   |   `-- usb at 47401800
>>>>>>>>> => fastboot usb 0
>>>>>>>>> => bind /ocp/usb at 47400000/usb at 47401000 ti-musb-peripheral
>>>>>>>>> => dm tree
>>>>>>>>>      misc          0  [ + ]   ti-musb-wrapper       |   |-- usb at 47400000
>>>>>>>>>      usb           0  [   ]   ti-musb-host          |   |   |-- usb at 47401800
>>>>>>>>>      usb           0  [   ]   ti-musb-peripheral    |   |   `-- usb at 47401000
>>>>>>>>> => fastboot usb 0
>>>>>>>>> musb-hdrc: peripheral reset irq lost!
>>>>>>>>> # works! (the irq-related line above as always been there)
>>>>>>>>>
>>>>>>>>> So now, how do we make this process easy/understandable?
>>>>>>>>
>>>>>>>> What would be your proposal ?
>>>>>
>>>>> At least I would appreciate:
>>>>> - to select CMD_BIND "by default" when relevant
>>>>> - to make the fastboot error more readable for the regular user
>>>>
>>>> Since with this 'unbind ethernet 0' this is orthogonal to this series, send separate patches, thanks.
>>>
>>> This is not orthogonal, I am sorry.
>>>
>>> version X:
>>> - tftp works "out of the box"
>>> - fastboot works "out of the box"
>>> version X+1:
>>> - tftp works "out of the box"
>>> - fastboot returns an obscure error
>>>
>>> 1/ If we now *need* the bind/unbind commands, the series must take care
>>>     of it.
>>> 2/ Without proper error message you just break fastboot for most
>>>     regular users (basically everyone but few U-Boot devs).
>>
>> You're missing the class of users that will be impacted here.  In order
>> for there to be a change here, you have to already be in the case where
>> you have CONFIG_USB_ETHER=y and gadget ethernet device isn't just
>> enabled but also initialized by default by calling usb_ether_init().
>> That's a very small list.  It's basically am33xx, two mediatek reference
>> platforms and xilinx_zynqmp_virt.  Given that am33xx defconfigs also
>> setup DFU, I'm not really sure just how many people use gadget ethernet.
>> The normal flow on modern devices is to be calling bind/unbind here
>> already.
> 
> Can we make this behavior explicit to the user? I am sorry, maybe it is
> the normal flow for you, but I am a regular U-Boot user and I totally
> missed that requirement.
> 
> Typical situation: one needs to use <whatever-gadget> but none is bound
> to the UDC (or another is bound), could we make the error messages more
> explicit if we decide not to unbind/bind the right one automatically
> because it is too "costly"?

Maybe you could implement a documentation patch, since you are not yet 
tainted by all the "I work on in day in day out, so it is obvious to me" 
thing ?


More information about the U-Boot mailing list