Hello,
Does this such patch make sense ? When a device is disconnected ,
it seems that the driver is the one who disable the device's endpoints
no ?
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 0b92934..ef67ebc 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -2054,26 +2054,26 @@ EXPORT_SYMBOL (usb_gadget_register_drive
static void
stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
{
- int i;
-
/* don't disconnect if it's not connected */
if (dev->gadget.speed == USB_SPEED_UNKNOWN)
driver = NULL;
- /* stop hardware; prevent new request submissions;
- * and kill any outstanding requests.
- */
- usb_reset (dev);
- for (i = 0; i < 7; i++)
- nuke (&dev->ep [i]);
+ /* stop hardware; prevent new request submissions; */
+ usb_reset(dev);
/* report disconnect; the driver is already quiesced */
+ spin_unlock (&dev->lock);
if (driver) {
- spin_unlock (&dev->lock);
- driver->disconnect (&dev->gadget);
- spin_lock (&dev->lock);
+ /* let the drivers disable its eps */
+ driver->disconnect(&dev->gadget);
+ } else {
+ int i;
+ /* ...or do it by ourself */
+ for (i = 0; i < 7; i++)
+ net2280_disable(&dev->ep[i].ep);
}
-
+ spin_lock (&dev->lock);
+
usb_reinit (dev);
}
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel