Hi,
>>>> I finally bisect the kernel (I didn't known that command, thanks for the
>>>> tip)
>>>> and found that it doesn't work anymore from this commit :
>>>>
>>>> b0bac2581c1918cc4ab0aca01977ad69f0bc127a is the first bad commit
>>>> commit b0bac2581c1918cc4ab0aca01977ad69f0bc127a
>>>> Author: Robert Baldyga <[email protected]>
>>>> Date: Wed Sep 16 12:10:42 2015 +0200
>>>>
>>>> usb: gadget: introduce 'enabled' flag in struct usb_ep
>>>>
>>>> This patch introduces 'enabled' flag in struct usb_ep, and modifies
>>>> usb_ep_enable() and usb_ep_disable() functions to encapsulate endpoint
>>>> enabled/disabled state. It helps to avoid enabling endpoints which are
>>>> already enabled, and disabling endpoints which are already disables.
>>>>
>>>> From now USB functions don't have to remember current endpoint
>>>> enable/disable state, as this state is now handled automatically which
>>>> makes this API less bug-prone.
>>>>
>>>> Signed-off-by: Robert Baldyga <[email protected]>
>>>> Signed-off-by: Felipe Balbi <[email protected]>
>>>>
>>>>
>>>> If I comment the test in function usb_ep_enable and usb_ep_disable to avoid
>>>> enabling or disabling endpoints that already are, it works.
>>>> But I guess the real issue is that this function is called more than once
>>>> at some point?
>>>
>>> This is the second bug report involving Robert's series, we really need
>>> to give some deeper attention to this. Robert, care to comment ?
>>>
>>> So, this means that if you let endpoints be enabled or disabled more
>>> than once, then it works ? Sounds like a bug in the UDC controller to
>>> me. Robert's patch just helped trigger the problem. Which controller
>>> were you using again ? Was it Atmel UDC ?
>>
>> Yes that's it, and issue occurs when I unplug/plug the cable... On first
>> connection it works.
>> And yes I am using using atmel_usba_udc.c module.
>
>I wonder if there's a bug on atmel (or rndis function) where on cable
>disconnect, endpoint is left enabled. Can you check ?
Ok you are right, and indeed it seems related to Atmel udc driver.
Call to the function usba_ep_disable in atmel_usba_udc.c fail because
of this code :
if (!ep->ep.desc) {
spin_unlock_irqrestore(&udc->lock, flags);
/* REVISIT because this driver disables endpoints in
* reset_all_endpoints() before calling disconnect(),
* most gadget drivers would trigger this non-error ...
*/
if (udc->gadget.speed != USB_SPEED_UNKNOWN)
DBG(DBG_ERR, "ep_disable: %s not enabled\n",
ep->ep.name);
return -EINVAL;
}
That means that the function usb_ep_disable will not reset the enabled
flag so we think that endpoint is still enabled.
To confirm I just test without this part of code and it seems to work
but I don't know how it should be fixed, I am not very familiar with this...
Regards,
Gil
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html