During modprobe of gadget driver, pullup(RUN) is called after udc_start. To follow symmetry while removing gadget driver, pullup(STOP) is called before udc_stop. This is needed for aggressive PM where udc_stop disables the module completely. With aggressive PM, the module is completely disabled, clocks are cut during udc_stop. Calling disconnect after udc_stop necessiates clocks to be enabled again. Cc: Felipe Balbi <balbi@xxxxxx> Signed-off-by: Partha Basak <p-basak2@xxxxxx> Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx> --- Tested modprobe g_zero and rmmod g_zero with 4430SDP (musb) to test for any regression. Applied and Tested on linus tree. git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit 69a7aebcf019ab3ff5764525ad6858fbe23bb86d Merge: d464c92 f1f996b Author: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Date: Tue Mar 20 21:12:50 2012 -0700 drivers/usb/gadget/udc-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index 56da49f..24c099f 100644 --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c @@ -264,8 +264,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) if (udc_is_newstyle(udc)) { udc->driver->disconnect(udc->gadget); udc->driver->unbind(udc->gadget); - usb_gadget_udc_stop(udc->gadget, udc->driver); usb_gadget_disconnect(udc->gadget); + usb_gadget_udc_stop(udc->gadget, udc->driver); } else { usb_gadget_stop(udc->gadget, udc->driver); } -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html