This is a note to let you know that I've just added the patch titled usb: dwc2/gadget: fix phy disable sequence to the 3.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-dwc2-gadget-fix-phy-disable-sequence.patch and it can be found in the queue-3.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0655314be0d9c54ad5f63500219485c6a9d9e5e2 Mon Sep 17 00:00:00 2001 From: Kamil Debski <k.debski@xxxxxxxxxxx> Date: Tue, 9 Sep 2014 10:44:08 +0200 Subject: usb: dwc2/gadget: fix phy disable sequence From: Kamil Debski <k.debski@xxxxxxxxxxx> commit 0655314be0d9c54ad5f63500219485c6a9d9e5e2 upstream. When the driver is removed s3c_hsotg_phy_disable is called three times instead of once. This results in decreasing of the phy reference counter below zero and thus consecutive inserts of the module fails. This patch removes calls to s3c_hsotg_phy_disable from s3c_hsotg_remove and s3c_hsotg_udc_stop. s3c_hsotg_udc_stop is called from udc-core.c only after usb_gadget_disconnect, which in turn calls s3c_hsotg_pullup, which already calls s3c_hsotg_phy_disable. s3c_hsotg_remove must be called only after udc_stop, so there is no point in disabling phy once again there. Signed-off-by: Kamil Debski <k.debski@xxxxxxxxxxx> Signed-off-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Signed-off-by: Robert Baldyga <r.baldyga@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/dwc2/gadget.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2898,8 +2898,6 @@ static int s3c_hsotg_udc_stop(struct usb spin_lock_irqsave(&hsotg->lock, flags); - s3c_hsotg_phy_disable(hsotg); - if (!driver) hsotg->driver = NULL; @@ -3586,7 +3584,6 @@ static int s3c_hsotg_remove(struct platf usb_gadget_unregister_driver(hsotg->driver); } - s3c_hsotg_phy_disable(hsotg); if (hsotg->phy) phy_exit(hsotg->phy); clk_disable_unprepare(hsotg->clk); Patches currently in stable-queue which might be from k.debski@xxxxxxxxxxx are queue-3.16/usb-dwc2-gadget-fix-phy-disable-sequence.patch queue-3.16/usb-dwc2-gadget-fix-phy-initialization-sequence.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html