Hi, With 59310d1ec an "enabled" flag has been introduced to guard ep->ops against disable before enable or vice versa. In atmel_usba_udc/usba_ep_disable() returns an error if the endpoint is already disabled. When the gadget is re-attached, for example a dhcp command triggers usb_gadget_ops.pullup event, the bus is reset and atmel_usba_udc/reset_all_endpoints() is called. Since ep->enabled flag is still true, following usb_ep_disable()/usb_ep_enable() calls will fail.
What's the correct fix, change atmel_usba_udc/reset_all_endpoints() ? Regards, Zixun

