[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1431002836-9711-8-git-send-email-ramneek.mehresh@freescale.com>
Date: Thu, 7 May 2015 18:17:14 +0530
From: Ramneek Mehresh <ramneek.mehresh@...escale.com>
To: <linux-kernel@...r.kernel.org>
CC: <balbi@...com>, <linux-usb@...r.kernel.org>,
<stern@...land.harvard.edu>, <gregkh@...uxfoundation.org>,
Ramneek Mehresh <ramneek.mehresh@...escale.com>
Subject: [PATCH 08/10] usb:fsl:otg: Add host-gadget drv sync delay
Resolve synchronization issue between host and gadget drivers
upon role-reversal
Signed-off-by: Ramneek Mehresh <ramneek.mehresh@...escale.com>
Reviewed-by: Li Yang-R58472 <LeoLi@...escale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@...escale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@...escale.com>
---
drivers/usb/phy/phy-fsl-usb.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index ce40d5c..a3a578d 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -544,8 +544,17 @@ int fsl_otg_start_gadget(struct otg_fsm *fsm, int on)
dev = otg->gadget->dev.parent;
if (on) {
- if (dev->driver->resume)
+ /* Delay gadget resume to synchronize between host and gadget
+ * drivers. Upon role-reversal host drv is shutdown by kernel
+ * worker thread. By the time host drv shuts down, controller
+ * gets programmed for gadget role. Shutting host drv after
+ * this results in controller getting reset, and it stops
+ * responding to otg events
+ */
+ if (dev->driver->resume) {
+ msleep(1000);
dev->driver->resume(dev);
+ }
} else {
if (dev->driver->suspend)
dev->driver->suspend(dev, otg_suspend_state);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists