Re: [PATCH] usb: cdns3: gadget: Don't manage pullups

From: Felipe Balbi
Date: Fri Oct 25 2019 - 06:13:58 EST



Hi,

Roger Quadros <rogerq@xxxxxx> writes:
> On 25/10/2019 06:13, Peter Chen wrote:
>> On 19-10-23 09:17:45, Pawel Laszczak wrote:
>>> Hi,
>>>
>>> Reviewed-by: Pawel Laszczak <pawell@xxxxxxxxxxx>
>>
>> Hi Roger & Pawel,
>>
>> Assume gadget function has already enabled, if you switch host mode
>> to device mode, with your changes, where the device mode will be enabled
>> again?
>
> When it switches from device mode to host the UDC is removed. When we switch
> back from host to device mode the UDC is added, so,
>
> usb_add_gadget_udc_release()-> check_pending_gadget_drivers()->
> udc_bind_to_driver()->usb_udc_connect_control()->usb_gadget_connect()->
> gadget->ops->pullup()

I agree with Roger here. UDC shouldn't try to manage pullups
directly. If there are any bugs related to role switch, we should fix it
in udc core, so the fix applies to everyone ;-)

--
balbi

Attachment: signature.asc
Description: PGP signature