All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue
@ 2013-10-02 10:15 Majunath Goudar
  2013-10-02 10:15 ` [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
                   ` (16 more replies)
  0 siblings, 17 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci bus glue was not properly handled as
it was not suspending generic part of ohci controller. Alan Stern suggested, 
properly handle ohci suspend scenario. 

Calling explicitly the ohci_suspend()routine will ensure proper handling
of suspend scenario.
 

*** BLURB HERE ***

Manjunath Goudar (11):
  USB: OHCI: Properly handle OHCI controller suspend
  USB: OHCI: Properly handle ohci-at91 suspend
  USB: OHCI: Properly handle ohci-s3c2410 suspend
  USB: OHCI: Properly handle ohci-da8xx suspend
  USB: OHCI: Properly handle ohci-ep93xx suspend
  USB: OHCI: Properly handle ohci-exynos suspend
  USB: OHCI: Properly handle ohci-omap suspend
  USB: OHCI: Properly handle ohci-platform suspend
  USB: OHCI: Properly handle ohci-pxa27x suspend
  USB: OHCI: Properly handle ohci-sm501 suspend
  USB: OHCI: Properly handle ohci-spear suspend

 drivers/usb/host/ohci-at91.c     |   10 ++++++++--
 drivers/usb/host/ohci-da8xx.c    |   15 +++++++++++----
 drivers/usb/host/ohci-ep93xx.c   |   11 +++++++++--
 drivers/usb/host/ohci-exynos.c   |   20 +++++---------------
 drivers/usb/host/ohci-hcd.c      |    9 ++++++++-
 drivers/usb/host/ohci-omap.c     |   13 ++++++++++---
 drivers/usb/host/ohci-platform.c |   11 +++++++++--
 drivers/usb/host/ohci-pxa27x.c   |    9 ++++++++-
 drivers/usb/host/ohci-s3c2410.c  |   21 ++++-----------------
 drivers/usb/host/ohci-sm501.c    |   11 +++++++++--
 drivers/usb/host/ohci-spear.c    |   12 +++++++++---
 11 files changed, 90 insertions(+), 52 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 02/11] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of OHCI was not properly
handled in ochi_suspend()routine. Alan Stern
suggested, properly handle OHCI suspend scenario.

This does generic proper handling of suspend
scenario to all OHCI SOC.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-hcd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 8ada13f..310bcfe 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1036,6 +1036,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
 	unsigned long	flags;
+	int		rc = 0;
 
 	/* Disable irq emission and mark HW unaccessible. Use
 	 * the spinlock to properly synchronize with possible pending
@@ -1048,7 +1049,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 	spin_unlock_irqrestore (&ohci->lock, flags);
 
-	return 0;
+	synchronize_irq(hcd->irq);
+
+	if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) {
+		ohci_resume(hcd, false);
+		rc = -EBUSY;
+	}
+	return rc;
 }
 EXPORT_SYMBOL_GPL(ohci_suspend);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 02/11] USB: OHCI: Properly handle ohci-at91 suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-10-02 10:15 ` [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-at91 glue was not properly handled
as it was not suspending generic part of ohci controller. Alan Stern
suggested, properly handle ohci-at91 suspend scenario.

Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_drv_suspend()
will ensure proper handling of suspend scenario. This task is sugested
by Alan Stern.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-at91.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 476b5a5..f2d8403 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -636,8 +636,14 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
 	struct usb_hcd	*hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+	bool		do_wakeup = device_may_wakeup(&pdev->dev);
+	int		ret;
 
-	if (device_may_wakeup(&pdev->dev))
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
+	if (do_wakeup)
 		enable_irq_wake(hcd->irq);
 
 	/*
@@ -658,7 +664,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 		at91_stop_clock();
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-10-02 10:15 ` [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
  2013-10-02 10:15 ` [PATCH 02/11] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (2 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-da8xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-da8xx suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_da8xx_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-da8xx.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 9be59f1..f8238a4 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -406,19 +406,26 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message)
+static int ohci_da8xx_suspend(struct platform_device *pdev,
+				pm_message_t message)
 {
-	struct usb_hcd	*hcd	= platform_get_drvdata(dev);
+	struct usb_hcd	*hcd	= platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci	= hcd_to_ohci(hcd);
+	bool		do_wakeup	= device_may_wakeup(&pdev->dev);
+	int		ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	ohci_da8xx_clock(0);
 	hcd->state = HC_STATE_SUSPENDED;
-	dev->dev.power.power_state = PMSG_SUSPEND;
-	return 0;
+
+	return ret;
 }
 
 static int ohci_da8xx_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (3 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-14 15:49   ` Olof Johansson
  2013-10-02 10:15 ` [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-ep93xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-ep93xx suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-ep93xx.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index 492f681..08409bf 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -112,13 +112,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
 {
 	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(&pdev->dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
-	clk_disable(usb_host_clock);
-	return 0;
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
+	ep93xx_stop_hc(&pdev->dev);
+
+	return ret;
 }
 
 static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (4 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 11:34   ` Bartlomiej Zolnierkiewicz
  2013-10-02 10:15 ` [PATCH 07/11] USB: OHCI: Properly handle ohci-omap suspend Majunath Goudar
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 3e4bc74..f5f372e 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -203,24 +203,15 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
+	spin_lock_irqsave(&ohci->lock, flags);
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
 
@@ -228,7 +219,6 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 07/11] USB: OHCI: Properly handle ohci-omap suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (5 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 08/11] USB: OHCI: Properly handle ohci-platform suspend Majunath Goudar
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-omap glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-omap suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_omap_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-omap.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 18b27a2..f253214 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -431,16 +431,23 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev)
 
 #ifdef	CONFIG_PM
 
-static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
+static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message)
 {
-	struct ohci_hcd	*ohci = hcd_to_ohci(platform_get_drvdata(dev));
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
+	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(&pdev->dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	omap_ohci_clock_power(0);
-	return 0;
+	return ret;
 }
 
 static int ohci_omap_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 08/11] USB: OHCI: Properly handle ohci-platform suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (6 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 07/11] USB: OHCI: Properly handle ohci-omap suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Majunath Goudar
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-platform glue was not
properly handled as it was not suspending generic part
of ohci controller.Alan Stern suggested, properly handle
ohci-platform suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_platform_suspend() will ensure proper handling of
suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-platform.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index a4c6410..f351ff5 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -139,14 +139,21 @@ static int ohci_platform_remove(struct platform_device *dev)
 
 static int ohci_platform_suspend(struct device *dev)
 {
-	struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
+	struct usb_hcd *hcd = dev_get_drvdata(dev);
+	struct usb_ohci_pdata *pdata = dev->platform_data;
 	struct platform_device *pdev =
 		container_of(dev, struct platform_device, dev);
+	bool do_wakeup = device_may_wakeup(dev);
+	int ret;
+
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
 
 	if (pdata->power_suspend)
 		pdata->power_suspend(pdev);
 
-	return 0;
+	return ret;
 }
 
 static int ohci_platform_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (7 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 08/11] USB: OHCI: Properly handle ohci-platform suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Majunath Goudar
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-pxa27x glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly
handle ohci-pxa27x suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_hcd_pxa27x_drv_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-pxa27x.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index c1b1fa3..deea5d1 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -509,13 +509,20 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev)
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
 	struct pxa27x_ohci *pxa_ohci = to_pxa27x_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(dev);
+	int ret;
+
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	pxa27x_stop_hc(pxa_ohci, dev);
-	return 0;
+	return ret;
 }
 
 static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 10/11] USB: OHCI: Properly handle ohci-sm501 suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (8 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-02 10:15 ` [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-sm501 glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly
handle ohci-sm501 suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_sm501_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-sm501.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index d479d5d..2a5de5f 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -216,14 +216,21 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
 static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg)
 {
 	struct device *dev = &pdev->dev;
-	struct ohci_hcd	*ohci = hcd_to_ohci(platform_get_drvdata(pdev));
+	struct usb_hcd  *hcd = platform_get_drvdata(pdev);
+	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0);
-	return 0;
+	return ret;
 }
 
 static int ohci_sm501_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (9 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Majunath Goudar
@ 2013-10-02 10:15 ` Majunath Goudar
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-02 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-spear glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly handle
ohci-spear suspend scenario.

Calling explicitly the ohci_suspend() routine in
spear_ohci_hcd_drv_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-spear.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 31ff3fc..41148f8 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev)
 }
 
 #if defined(CONFIG_PM)
-static int spear_ohci_hcd_drv_suspend(struct platform_device *dev,
+static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev,
 		pm_message_t message)
 {
-	struct usb_hcd *hcd = platform_get_drvdata(dev);
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
 	struct spear_ohci *sohci_p = to_spear_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(&pdev->dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	clk_disable_unprepare(sohci_p->clk);
 
-	return 0;
+	return ret;
 }
 
 static int spear_ohci_hcd_drv_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-02 10:15 ` [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
@ 2013-10-02 11:34   ` Bartlomiej Zolnierkiewicz
  2013-10-02 14:38     ` Alan Stern
  0 siblings, 1 reply; 68+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2013-10-02 11:34 UTC (permalink / raw)
  To: linux-arm-kernel


Hi,

On Wednesday, October 02, 2013 03:45:42 PM Majunath Goudar wrote:
> From: Manjunath Goudar <manjunath.goudar@linaro.org>
> 
> Suspend scenario in case of ohci-exynos glue was not
> properly handled as it was not suspending generic part
> of ohci controller. Alan Stern suggested, properly handle
> ohci-exynos suspend scenario.
> 
> Calling explicitly the ohci_suspend() routine in
> exynos_ohci_suspend() will ensure proper handling of suspend
> scenario.
> 
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg KH <greg@kroah.com>
> Cc: linux-usb at vger.kernel.org
> ---
>  drivers/usb/host/ohci-exynos.c |   20 +++++---------------
>  1 file changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
> index 3e4bc74..f5f372e 100644
> --- a/drivers/usb/host/ohci-exynos.c
> +++ b/drivers/usb/host/ohci-exynos.c
> @@ -203,24 +203,15 @@ static int exynos_ohci_suspend(struct device *dev)
>  	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
>  	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
>  	struct platform_device *pdev = to_platform_device(dev);
> +	bool do_wakeup = device_may_wakeup(dev);
>  	unsigned long flags;
>  	int rc = 0;
>  
> -	/*
> -	 * Root hub was already suspended. Disable irq emission and
> -	 * mark HW unaccessible, bail out if RH has been resumed. Use
> -	 * the spinlock to properly synchronize with possible pending
> -	 * RH suspend or resume activity.
> -	 */
> -	spin_lock_irqsave(&ohci->lock, flags);
> -	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
> -			ohci->rh_state != OHCI_RH_HALTED) {
> -		rc = -EINVAL;
> -		goto fail;
> -	}
> -
> -	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
> +	rc = ohci_suspend(hcd, do_wakeup);

Maybe it would make sense to cleanup ohci_suspend() first (before adding
new ohci_suspend() users) and remove unused do_wakeup parameter?

> +	if (rc)
> +		return rc;
>  
> +	spin_lock_irqsave(&ohci->lock, flags);
>  	if (exynos_ohci->otg)
>  		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
>  
> @@ -228,7 +219,6 @@ static int exynos_ohci_suspend(struct device *dev)
>  
>  	clk_disable_unprepare(exynos_ohci->clk);
>  
> -fail:
>  	spin_unlock_irqrestore(&ohci->lock, flags);
>  
>  	return rc;

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-02 11:34   ` Bartlomiej Zolnierkiewicz
@ 2013-10-02 14:38     ` Alan Stern
  2013-10-02 15:10       ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 68+ messages in thread
From: Alan Stern @ 2013-10-02 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2 Oct 2013, Bartlomiej Zolnierkiewicz wrote:

> Maybe it would make sense to cleanup ohci_suspend() first (before adding
> new ohci_suspend() users) and remove unused do_wakeup parameter?

Not possible.  The do_wakeup parameter is part of a function prototype
shared by other callback routines (such as ehci_suspend()) that _do_
use the parameter.

Alan Stern

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-02 14:38     ` Alan Stern
@ 2013-10-02 15:10       ` Bartlomiej Zolnierkiewicz
  2013-10-02 15:52         ` Alan Stern
  0 siblings, 1 reply; 68+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2013-10-02 15:10 UTC (permalink / raw)
  To: linux-arm-kernel


Hi,

On Wednesday, October 02, 2013 10:38:58 AM Alan Stern wrote:
> On Wed, 2 Oct 2013, Bartlomiej Zolnierkiewicz wrote:
> 
> > Maybe it would make sense to cleanup ohci_suspend() first (before adding
> > new ohci_suspend() users) and remove unused do_wakeup parameter?
> 
> Not possible.  The do_wakeup parameter is part of a function prototype
> shared by other callback routines (such as ehci_suspend()) that _do_
> use the parameter.

If you mean ohci-pci.c usage (which is currently the only usage of
ohci_suspend() looking at the latest -next kernel) than it is enough
to add a simple wrapper for it in ohci-pci.c:

...
static int ohci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
{
	ohci_suspend(hcd);
}
...
    ohci_pci_hc_driver.pci_suspend = ohci_pci_suspend;
...


Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-02 15:10       ` Bartlomiej Zolnierkiewicz
@ 2013-10-02 15:52         ` Alan Stern
  0 siblings, 0 replies; 68+ messages in thread
From: Alan Stern @ 2013-10-02 15:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2 Oct 2013, Bartlomiej Zolnierkiewicz wrote:

> 
> Hi,
> 
> On Wednesday, October 02, 2013 10:38:58 AM Alan Stern wrote:
> > On Wed, 2 Oct 2013, Bartlomiej Zolnierkiewicz wrote:
> > 
> > > Maybe it would make sense to cleanup ohci_suspend() first (before adding
> > > new ohci_suspend() users) and remove unused do_wakeup parameter?
> > 
> > Not possible.  The do_wakeup parameter is part of a function prototype
> > shared by other callback routines (such as ehci_suspend()) that _do_
> > use the parameter.
> 
> If you mean ohci-pci.c usage (which is currently the only usage of
> ohci_suspend() looking at the latest -next kernel) than it is enough
> to add a simple wrapper for it in ohci-pci.c:
> 
> ...
> static int ohci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
> {
> 	ohci_suspend(hcd);
> }
> ...
>     ohci_pci_hc_driver.pci_suspend = ohci_pci_suspend;
> ...

Ah, now I see your point.  Yes, it's true; that parameter could be 
eliminated.

Manjunath, would you like to update your patch series to get rid of the 
do_wakeup argument to ohci_suspend()?

Alan Stern

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (10 preceding siblings ...)
  2013-10-02 10:15 ` [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
@ 2013-10-03 13:02 ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
                     ` (10 more replies)
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (4 subsequent siblings)
  16 siblings, 11 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci bus glue was not properly handled as
it was not suspending generic part of ohci controller. Alan Stern suggested,
properly handle ohci suspend scenario.

Calling explicitly the ohci_suspend()routine will ensure proper handling
of suspend scenario.

V1->V2:
      -removed unused do_wakeup parameter.

Manjunath Goudar (11):
  USB: OHCI: Properly handle OHCI controller suspend
  USB: OHCI: Properly handle ohci-at91 suspend
  USB: OHCI: Properly handle ohci-s3c2410 suspend
  USB: OHCI: Properly handle ohci-da8xx suspend
  USB: OHCI: Properly handle ohci-ep93xx suspend
  USB: OHCI: Properly handle ohci-exynos suspend
  USB: OHCI: Properly handle ohci-omap suspend
  USB: OHCI: Properly handle ohci-platform suspend
  USB: OHCI: Properly handle ohci-pxa27x suspend
  USB: OHCI: Properly handle ohci-sm501 suspend
  USB: OHCI: Properly handle ohci-spear suspend

 drivers/usb/host/ohci-at91.c     |    8 +++++---
 drivers/usb/host/ohci-da8xx.c    |   14 ++++++++++----
 drivers/usb/host/ohci-ep93xx.c   |   10 ++++++++--
 drivers/usb/host/ohci-exynos.c   |   19 ++++---------------
 drivers/usb/host/ohci-hcd.c      |   11 +++++++++--
 drivers/usb/host/ohci-omap.c     |   12 +++++++++---
 drivers/usb/host/ohci-platform.c |   10 ++++++++--
 drivers/usb/host/ohci-pxa27x.c   |    8 +++++++-
 drivers/usb/host/ohci-s3c2410.c  |   20 +++-----------------
 drivers/usb/host/ohci-sm501.c    |   10 ++++++++--
 drivers/usb/host/ohci-spear.c    |   11 ++++++++---
 drivers/usb/host/ohci.h          |    2 +-
 12 files changed, 80 insertions(+), 55 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V2 01/11] USB: OHCI: Properly handle OHCI controller suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 02/11] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of OHCI was not properly
handled in ochi_suspend()routine. Alan Stern
suggested, properly handle OHCI suspend scenario.

This does generic proper handling of suspend
scenario to all OHCI SOC.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-hcd.c |   11 +++++++++--
 drivers/usb/host/ohci.h     |    2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 8ada13f..46087a1 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1032,10 +1032,11 @@ EXPORT_SYMBOL_GPL(ohci_restart);
 
 #ifdef CONFIG_PM
 
-int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
+int ohci_suspend(struct usb_hcd *hcd)
 {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
 	unsigned long	flags;
+	int		rc = 0;
 
 	/* Disable irq emission and mark HW unaccessible. Use
 	 * the spinlock to properly synchronize with possible pending
@@ -1048,7 +1049,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 	spin_unlock_irqrestore (&ohci->lock, flags);
 
-	return 0;
+	synchronize_irq(hcd->irq);
+
+	if (HCD_WAKEUP_PENDING(hcd)) {
+		ohci_resume(hcd, false);
+		rc = -EBUSY;
+	}
+	return rc;
 }
 EXPORT_SYMBOL_GPL(ohci_suspend);
 
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index e2e5faa..f2ebd423 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -735,6 +735,6 @@ extern void	ohci_init_driver(struct hc_driver *drv,
 extern int	ohci_restart(struct ohci_hcd *ohci);
 extern int	ohci_setup(struct usb_hcd *hcd);
 #ifdef CONFIG_PM
-extern int	ohci_suspend(struct usb_hcd *hcd, bool do_wakeup);
+extern int	ohci_suspend(struct usb_hcd *hcd);
 extern int	ohci_resume(struct usb_hcd *hcd, bool hibernated);
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 02/11] USB: OHCI: Properly handle ohci-at91 suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
                     ` (8 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-at91 glue was not properly handled
as it was not suspending generic part of ohci controller. Alan Stern
suggested, properly handle ohci-at91 suspend scenario.

Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_drv_suspend()
will ensure proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-at91.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 476b5a5..13449cc 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -636,9 +636,11 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
 	struct usb_hcd	*hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+	int		ret;
 
-	if (device_may_wakeup(&pdev->dev))
-		enable_irq_wake(hcd->irq);
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
 
 	/*
 	 * The integrated transceivers seem unable to notice disconnect,
@@ -658,7 +660,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 		at91_stop_clock();
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 02/11] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
                     ` (7 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..0d2a98d 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,14 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 04/11] USB: OHCI: Properly handle ohci-da8xx suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (2 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
                     ` (6 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-da8xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-da8xx suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_da8xx_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-da8xx.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 9be59f1..4b9a7a3 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -406,19 +406,25 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message)
+static int ohci_da8xx_suspend(struct platform_device *pdev,
+				pm_message_t message)
 {
-	struct usb_hcd	*hcd	= platform_get_drvdata(dev);
+	struct usb_hcd	*hcd	= platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci	= hcd_to_ohci(hcd);
+	int		ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
+
 	ohci_da8xx_clock(0);
 	hcd->state = HC_STATE_SUSPENDED;
-	dev->dev.power.power_state = PMSG_SUSPEND;
-	return 0;
+
+	return ret;
 }
 
 static int ohci_da8xx_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (3 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
                     ` (5 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-ep93xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-ep93xx suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-ep93xx.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index 492f681..fe60e72 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -112,13 +112,19 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
 {
 	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
-	clk_disable(usb_host_clock);
-	return 0;
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
+
+	ep93xx_stop_hc(&pdev->dev);
+
+	return ret;
 }
 
 static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 06/11] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (4 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 07/11] USB: OHCI: Properly handle ohci-omap suspend Majunath Goudar
                     ` (4 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 3e4bc74..47e9c38 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -206,21 +206,11 @@ static int exynos_ohci_suspend(struct device *dev)
 	unsigned long flags;
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd);
+	if (rc)
+		return rc;
 
+	spin_lock_irqsave(&ohci->lock, flags);
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
 
@@ -228,7 +218,6 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 07/11] USB: OHCI: Properly handle ohci-omap suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (5 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 08/11] USB: OHCI: Properly handle ohci-platform suspend Majunath Goudar
                     ` (3 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-omap glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-omap suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_omap_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-omap.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 18b27a2..ec2d04c 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -431,16 +431,22 @@ static int ohci_hcd_omap_drv_remove(struct platform_device *dev)
 
 #ifdef	CONFIG_PM
 
-static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
+static int ohci_omap_suspend(struct platform_device *pdev, pm_message_t message)
 {
-	struct ohci_hcd	*ohci = hcd_to_ohci(platform_get_drvdata(dev));
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
+	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
+
 	omap_ohci_clock_power(0);
-	return 0;
+	return ret;
 }
 
 static int ohci_omap_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 08/11] USB: OHCI: Properly handle ohci-platform suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (6 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 07/11] USB: OHCI: Properly handle ohci-omap suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Majunath Goudar
                     ` (2 subsequent siblings)
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-platform glue was not
properly handled as it was not suspending generic part
of ohci controller.Alan Stern suggested, properly handle
ohci-platform suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_platform_suspend() will ensure proper handling of
suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-platform.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index a4c6410..d67f841 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -139,14 +139,20 @@ static int ohci_platform_remove(struct platform_device *dev)
 
 static int ohci_platform_suspend(struct device *dev)
 {
-	struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
+	struct usb_hcd *hcd = dev_get_drvdata(dev);
+	struct usb_ohci_pdata *pdata = dev->platform_data;
 	struct platform_device *pdev =
 		container_of(dev, struct platform_device, dev);
+	int ret;
+
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
 
 	if (pdata->power_suspend)
 		pdata->power_suspend(pdev);
 
-	return 0;
+	return ret;
 }
 
 static int ohci_platform_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (7 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 08/11] USB: OHCI: Properly handle ohci-platform suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 11/11] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-pxa27x glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly
handle ohci-pxa27x suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_hcd_pxa27x_drv_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-pxa27x.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index c1b1fa3..3b77109 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -509,13 +509,19 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev)
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
 	struct pxa27x_ohci *pxa_ohci = to_pxa27x_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	int ret;
+
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
+
 	pxa27x_stop_hc(pxa_ohci, dev);
-	return 0;
+	return ret;
 }
 
 static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 10/11] USB: OHCI: Properly handle ohci-sm501 suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (8 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  2013-10-03 13:02   ` [PATCH V2 11/11] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-sm501 glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly
handle ohci-sm501 suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_sm501_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-sm501.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index d479d5d..cdf25ef 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -216,14 +216,20 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
 static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg)
 {
 	struct device *dev = &pdev->dev;
-	struct ohci_hcd	*ohci = hcd_to_ohci(platform_get_drvdata(pdev));
+	struct usb_hcd  *hcd = platform_get_drvdata(pdev);
+	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
+
 	sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0);
-	return 0;
+	return ret;
 }
 
 static int ohci_sm501_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 11/11] USB: OHCI: Properly handle ohci-spear suspend
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (9 preceding siblings ...)
  2013-10-03 13:02   ` [PATCH V2 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Majunath Goudar
@ 2013-10-03 13:02   ` Majunath Goudar
  10 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-03 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-spear glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly handle
ohci-spear suspend scenario.

Calling explicitly the ohci_suspend() routine in
spear_ohci_hcd_drv_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-spear.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 31ff3fc..d6787a8 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -130,20 +130,25 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev)
 }
 
 #if defined(CONFIG_PM)
-static int spear_ohci_hcd_drv_suspend(struct platform_device *dev,
+static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev,
 		pm_message_t message)
 {
-	struct usb_hcd *hcd = platform_get_drvdata(dev);
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
 	struct spear_ohci *sohci_p = to_spear_ohci(hcd);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd);
+	if (ret)
+		return ret;
+
 	clk_disable_unprepare(sohci_p->clk);
 
-	return 0;
+	return ret;
 }
 
 static int spear_ohci_hcd_drv_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-02 10:15 ` [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
@ 2013-10-14 15:49   ` Olof Johansson
  2013-10-14 20:34     ` Alan Stern
  0 siblings, 1 reply; 68+ messages in thread
From: Olof Johansson @ 2013-10-14 15:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Greg,

[Adding ep93xx maintainers as well]

On Wed, Oct 2, 2013 at 3:15 AM, Majunath Goudar <csmanjuvijay@gmail.com> wrote:
> From: Manjunath Goudar <manjunath.goudar@linaro.org>
>
> Suspend scenario in case of ohci-ep93xx glue was not
> properly handled as it was not suspending generic part
> of ohci controller. Alan Stern suggested, properly handle
> ohci-ep93xx suspend scenario.
>
> Calling explicitly the ohci_suspend() routine in
> ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
> suspend scenario.
>
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg KH <greg@kroah.com>
> Cc: linux-usb at vger.kernel.org
> ---
>  drivers/usb/host/ohci-ep93xx.c |   11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
> index 492f681..08409bf 100644
> --- a/drivers/usb/host/ohci-ep93xx.c
> +++ b/drivers/usb/host/ohci-ep93xx.c
> @@ -112,13 +112,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
>  {
>         struct usb_hcd *hcd = platform_get_drvdata(pdev);
>         struct ohci_hcd *ohci = hcd_to_ohci(hcd);
> +       bool do_wakeup = device_may_wakeup(&pdev->dev);
> +       int ret;
>
>         if (time_before(jiffies, ohci->next_statechange))
>                 msleep(5);
>         ohci->next_statechange = jiffies;
>
> -       clk_disable(usb_host_clock);
> -       return 0;
> +       ret = ohci_suspend(hcd, do_wakeup);
> +       if (ret)
> +               return ret;
> +
> +       ep93xx_stop_hc(&pdev->dev);
> +
> +       return ret;
>  }

This patch showed up in -next today (or maybe a while ago and I didn't
notice). It's causing a build failure on ep93xx:

>From http://arm-soc.lixom.net/buildlogs/next-thierry/v3.12-rc5-5366-gba2e8c2/buildall.arm.ep93xx_defconfig.log.failed:

drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
function 'ep93xx_stop_hc'


It's really confusing though, because Majunath has posted this patch
three times. The first time it had the ep93xx_stop_hc() call in there,
the second patch (labelled V2) did not, and the third(?) version,
without version label, also lacked it. No revision log in the patch,
and no comments on it.

But it does seem like the wrong version was merged based on build results.


-Olof

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-14 15:49   ` Olof Johansson
@ 2013-10-14 20:34     ` Alan Stern
  2013-10-14 20:41       ` Greg KH
  2013-10-14 20:42       ` Hartley Sweeten
  0 siblings, 2 replies; 68+ messages in thread
From: Alan Stern @ 2013-10-14 20:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 14 Oct 2013, Olof Johansson wrote:

> Hi, Greg,
> 
> [Adding ep93xx maintainers as well]
> 
> On Wed, Oct 2, 2013 at 3:15 AM, Majunath Goudar <csmanjuvijay@gmail.com> wrote:
> > From: Manjunath Goudar <manjunath.goudar@linaro.org>
> >
> > Suspend scenario in case of ohci-ep93xx glue was not
> > properly handled as it was not suspending generic part
> > of ohci controller. Alan Stern suggested, properly handle
> > ohci-ep93xx suspend scenario.
> >
> > Calling explicitly the ohci_suspend() routine in
> > ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
> > suspend scenario.

> > --- a/drivers/usb/host/ohci-ep93xx.c
> > +++ b/drivers/usb/host/ohci-ep93xx.c
> > @@ -112,13 +112,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
> >  {
> >         struct usb_hcd *hcd = platform_get_drvdata(pdev);
> >         struct ohci_hcd *ohci = hcd_to_ohci(hcd);
> > +       bool do_wakeup = device_may_wakeup(&pdev->dev);
> > +       int ret;
> >
> >         if (time_before(jiffies, ohci->next_statechange))
> >                 msleep(5);
> >         ohci->next_statechange = jiffies;
> >
> > -       clk_disable(usb_host_clock);
> > -       return 0;
> > +       ret = ohci_suspend(hcd, do_wakeup);
> > +       if (ret)
> > +               return ret;
> > +
> > +       ep93xx_stop_hc(&pdev->dev);
> > +
> > +       return ret;
> >  }
> 
> This patch showed up in -next today (or maybe a while ago and I didn't
> notice). It's causing a build failure on ep93xx:
> 
> From http://arm-soc.lixom.net/buildlogs/next-thierry/v3.12-rc5-5366-gba2e8c2/buildall.arm.ep93xx_defconfig.log.failed:
> 
> drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
> drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
> function 'ep93xx_stop_hc'
> 
> 
> It's really confusing though, because Majunath has posted this patch
> three times. The first time it had the ep93xx_stop_hc() call in there,
> the second patch (labelled V2) did not, and the third(?) version,
> without version label, also lacked it. No revision log in the patch,
> and no comments on it.

In fact he has posted it a lot more than 3 times, and the version 
numbers (or lack thereof) are definitely confusing.

The reason for the build failure is that Manjanuth started work on this 
patch many months ago -- back in the spring.  At that time the 
ep93xx_stop_hc() routine did exist.

But commit af3f233fd27b (usb: ohci-ep93xx: tidy up driver (*probe) and 
(*remove)), dated July 1, removed it.  Manjunath never updated his 
patch in response.

> But it does seem like the wrong version was merged based on build results.

No, it's a rebasing failure, not a wrong version.

Alan Stern

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-14 20:34     ` Alan Stern
@ 2013-10-14 20:41       ` Greg KH
  2013-10-14 20:42       ` Hartley Sweeten
  1 sibling, 0 replies; 68+ messages in thread
From: Greg KH @ 2013-10-14 20:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 14, 2013 at 04:34:56PM -0400, Alan Stern wrote:
> On Mon, 14 Oct 2013, Olof Johansson wrote:
> 
> > Hi, Greg,
> > 
> > [Adding ep93xx maintainers as well]
> > 
> > On Wed, Oct 2, 2013 at 3:15 AM, Majunath Goudar <csmanjuvijay@gmail.com> wrote:
> > > From: Manjunath Goudar <manjunath.goudar@linaro.org>
> > >
> > > Suspend scenario in case of ohci-ep93xx glue was not
> > > properly handled as it was not suspending generic part
> > > of ohci controller. Alan Stern suggested, properly handle
> > > ohci-ep93xx suspend scenario.
> > >
> > > Calling explicitly the ohci_suspend() routine in
> > > ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
> > > suspend scenario.
> 
> > > --- a/drivers/usb/host/ohci-ep93xx.c
> > > +++ b/drivers/usb/host/ohci-ep93xx.c
> > > @@ -112,13 +112,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
> > >  {
> > >         struct usb_hcd *hcd = platform_get_drvdata(pdev);
> > >         struct ohci_hcd *ohci = hcd_to_ohci(hcd);
> > > +       bool do_wakeup = device_may_wakeup(&pdev->dev);
> > > +       int ret;
> > >
> > >         if (time_before(jiffies, ohci->next_statechange))
> > >                 msleep(5);
> > >         ohci->next_statechange = jiffies;
> > >
> > > -       clk_disable(usb_host_clock);
> > > -       return 0;
> > > +       ret = ohci_suspend(hcd, do_wakeup);
> > > +       if (ret)
> > > +               return ret;
> > > +
> > > +       ep93xx_stop_hc(&pdev->dev);
> > > +
> > > +       return ret;
> > >  }
> > 
> > This patch showed up in -next today (or maybe a while ago and I didn't
> > notice). It's causing a build failure on ep93xx:
> > 
> > From http://arm-soc.lixom.net/buildlogs/next-thierry/v3.12-rc5-5366-gba2e8c2/buildall.arm.ep93xx_defconfig.log.failed:
> > 
> > drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
> > drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
> > function 'ep93xx_stop_hc'
> > 
> > 
> > It's really confusing though, because Majunath has posted this patch
> > three times. The first time it had the ep93xx_stop_hc() call in there,
> > the second patch (labelled V2) did not, and the third(?) version,
> > without version label, also lacked it. No revision log in the patch,
> > and no comments on it.
> 
> In fact he has posted it a lot more than 3 times, and the version 
> numbers (or lack thereof) are definitely confusing.
> 
> The reason for the build failure is that Manjanuth started work on this 
> patch many months ago -- back in the spring.  At that time the 
> ep93xx_stop_hc() routine did exist.
> 
> But commit af3f233fd27b (usb: ohci-ep93xx: tidy up driver (*probe) and 
> (*remove)), dated July 1, removed it.  Manjunath never updated his 
> patch in response.
> 
> > But it does seem like the wrong version was merged based on build results.
> 
> No, it's a rebasing failure, not a wrong version.

I've reverted all of these patches now, hopefully from Linaro will step
up and fix them and resend them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-14 20:34     ` Alan Stern
  2013-10-14 20:41       ` Greg KH
@ 2013-10-14 20:42       ` Hartley Sweeten
  2013-10-14 20:50         ` Alan Stern
  1 sibling, 1 reply; 68+ messages in thread
From: Hartley Sweeten @ 2013-10-14 20:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, October 14, 2013 1:35 PM, Alan Stern wrote:
> On Mon, 14 Oct 2013, Olof Johansson wrote:
>
>> Hi, Greg,
>> 
>> [Adding ep93xx maintainers as well]
>> 
>> On Wed, Oct 2, 2013 at 3:15 AM, Majunath Goudar <csmanjuvijay@gmail.com> wrote:
>>> From: Manjunath Goudar <manjunath.goudar@linaro.org>
>>>
>>> Suspend scenario in case of ohci-ep93xx glue was not
>>> properly handled as it was not suspending generic part
>>> of ohci controller. Alan Stern suggested, properly handle
>>> ohci-ep93xx suspend scenario.
>>>
>>> Calling explicitly the ohci_suspend() routine in
>>> ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
>>> suspend scenario.
>
>>> --- a/drivers/usb/host/ohci-ep93xx.c
>>> +++ b/drivers/usb/host/ohci-ep93xx.c
>>> @@ -112,13 +112,20 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
>>>  {
>>>         struct usb_hcd *hcd = platform_get_drvdata(pdev);
>>>         struct ohci_hcd *ohci = hcd_to_ohci(hcd);
>>> +       bool do_wakeup = device_may_wakeup(&pdev->dev);
>>> +       int ret;
>>>
>>>         if (time_before(jiffies, ohci->next_statechange))
>>>                 msleep(5);
>>>         ohci->next_statechange = jiffies;
>>>
>>> -       clk_disable(usb_host_clock);
>>> -       return 0;
>>> +       ret = ohci_suspend(hcd, do_wakeup);
>>> +       if (ret)
>>> +               return ret;
>>> +
>>> +       ep93xx_stop_hc(&pdev->dev);
>>> +
>>> +       return ret;
>>>  }
>> 
>> This patch showed up in -next today (or maybe a while ago and I didn't
>> notice). It's causing a build failure on ep93xx:
>> 
>> From http://arm-soc.lixom.net/buildlogs/next-thierry/v3.12-rc5-5366-gba2e8c2/buildall.arm.ep93xx_defconfig.log.failed:
>> 
>> drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
>> drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
>> function 'ep93xx_stop_hc'
>> 
>> 
>> It's really confusing though, because Majunath has posted this patch
>> three times. The first time it had the ep93xx_stop_hc() call in there,
>> the second patch (labelled V2) did not, and the third(?) version,
>> without version label, also lacked it. No revision log in the patch,
>> and no comments on it.
>
> In fact he has posted it a lot more than 3 times, and the version 
> numbers (or lack thereof) are definitely confusing.
>
> The reason for the build failure is that Manjanuth started work on this 
> patch many months ago -- back in the spring.  At that time the 
> ep93xx_stop_hc() routine did exist.
>
> But commit af3f233fd27b (usb: ohci-ep93xx: tidy up driver (*probe) and 
>  (*remove)), dated July 1, removed it.  Manjunath never updated his 
> patch in response.
>
>> But it does seem like the wrong version was merged based on build results.
>
> No, it's a rebasing failure, not a wrong version.

Alan,

As an alternative to this patch, I have successfully used the ohci-platform
driver on the ep93xx. This does move a bit of glue code into the ep93xx
core (arch/arm/mach-ep93xx/core.c) but it removes the ohci-ep93xx glue
driver completely.

I can post a patch for this shortly if you would like.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-14 20:42       ` Hartley Sweeten
@ 2013-10-14 20:50         ` Alan Stern
  2013-10-14 21:07           ` Hartley Sweeten
  0 siblings, 1 reply; 68+ messages in thread
From: Alan Stern @ 2013-10-14 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 14 Oct 2013, Hartley Sweeten wrote:

> Alan,
> 
> As an alternative to this patch, I have successfully used the ohci-platform
> driver on the ep93xx. This does move a bit of glue code into the ep93xx
> core (arch/arm/mach-ep93xx/core.c) but it removes the ohci-ep93xx glue
> driver completely.
> 
> I can post a patch for this shortly if you would like.

That would be great!  It would save me the trouble of fixing 
Manjanuth's patch and it would remove a source file too!

Alan Stern

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-14 20:50         ` Alan Stern
@ 2013-10-14 21:07           ` Hartley Sweeten
  2013-10-15  4:32             ` Olof Johansson
  0 siblings, 1 reply; 68+ messages in thread
From: Hartley Sweeten @ 2013-10-14 21:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, October 14, 2013 1:50 PM, Alan Stern wrote:
> On Mon, 14 Oct 2013, Hartley Sweeten wrote:
>> As an alternative to this patch, I have successfully used the ohci-platform
>> driver on the ep93xx. This does move a bit of glue code into the ep93xx
>> core (arch/arm/mach-ep93xx/core.c) but it removes the ohci-ep93xx glue
>> driver completely.
>> 
>> I can post a patch for this shortly if you would like.
>
> That would be great!  It would save me the trouble of fixing 
> Manjanuth's patch and it would remove a source file too!

The only thing I'm not sure about use where to enable the
USB_OHCI_HCD_PLATFORM driver for ARCH_EP93XX.

Right now the ohci-ep93xx glue driver is enabled automatically
when USB_OHCI_HCD is enabled due to the ifdefery. I can add
a new config option similar to the other users of
USB_OHCI_HCD_PLATFORM but I was wondering if there is a
cleaner way.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-14 21:07           ` Hartley Sweeten
@ 2013-10-15  4:32             ` Olof Johansson
       [not found]               ` <CAKsNYyzFe+o0ctNYyHhL7m71LnAC4WTKbkfN37WHmLBRjgj9+w@mail.gmail.com>
  0 siblings, 1 reply; 68+ messages in thread
From: Olof Johansson @ 2013-10-15  4:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 14, 2013 at 2:07 PM, Hartley Sweeten
<HartleyS@visionengravers.com> wrote:
> On Monday, October 14, 2013 1:50 PM, Alan Stern wrote:
>> On Mon, 14 Oct 2013, Hartley Sweeten wrote:
>>> As an alternative to this patch, I have successfully used the ohci-platform
>>> driver on the ep93xx. This does move a bit of glue code into the ep93xx
>>> core (arch/arm/mach-ep93xx/core.c) but it removes the ohci-ep93xx glue
>>> driver completely.
>>>
>>> I can post a patch for this shortly if you would like.
>>
>> That would be great!  It would save me the trouble of fixing
>> Manjanuth's patch and it would remove a source file too!
>
> The only thing I'm not sure about use where to enable the
> USB_OHCI_HCD_PLATFORM driver for ARCH_EP93XX.
>
> Right now the ohci-ep93xx glue driver is enabled automatically
> when USB_OHCI_HCD is enabled due to the ifdefery. I can add
> a new config option similar to the other users of
> USB_OHCI_HCD_PLATFORM but I was wondering if there is a
> cleaner way.

Given that we're trying to reduce code under arch/arm and move it out
to driver directories instead, I'm not sure this is a step in the
right direction. :-) I guess it depends on how much code we're talking
about here, so let's take that discussion once patches are posted.


-Olof

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (11 preceding siblings ...)
  2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-10-15 13:19 ` Majunath Goudar
  2013-10-15 13:19   ` [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
                     ` (6 more replies)
       [not found] ` <1382016913-10872-1-git-send-email-csmanjuvijay@gmail.com>
                   ` (3 subsequent siblings)
  16 siblings, 7 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Majunath Goudar <manju.goudar@lge.com>

Suspend scenario in case of ohci bus glue was not properly handled as
it was not suspending generic part of ohci controller. Alan Stern suggested,
properly handle ohci suspend scenario.

Calling explicitly the ohci_suspend()routine will ensure proper handling
of suspend scenario.

V1->V2:
       -This version is fixing the ohci-ep93xx build error reported by Olof Johansson:

        drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
        drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
        function 'ep93xx_stop_hc'
      
        Due to the build failure on  "[PATCH 5/11] USB: OHCI: Properly handle 
        ohci-ep93xx suspend" following patches were reverted.
        [PATCH 1/11]USB: OHCI: Properly handle OHCI controller suspend
        [PATCH 2/11] USB: OHCI: Properly handle ohci-at91 suspend
        [PATCH 3/11] USB: OHCI: Properly handle ohci-s3c2410 suspend
        [PATCH 4/11] USB: OHCI: Properly handle ohci-da8xx suspend
        [PATCH 5/11] USB: OHCI: Properly handle ohci-ep93xx suspend  
        [PATCH 6/11] USB: OHCI: Properly handle ohci-exynos suspend
        [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend
   
        The following 4 patches are fine and present in usb-next
        Commit id "10abfa13"[PATCH 7/11] Properly handle ohci-omap suspend.
        Commit id "39dbd7df"[PATCH 8/11] Properly handle ohci-platform suspend.
        Commit id "4ceaa893"[PATCH 9/11] Properly handle ohci-pxa suspend.
        Commit id "f3c60599"[PATCH 10/11] Properly handle ohci-sm501 suspend.
    
        This patch set is working properly.  
 
Majunath Goudar (1):
  USB: OHCI: Properly handle ohci-ep93xx suspend

Manjunath Goudar (6):
  USB: OHCI: Properly handle OHCI controller suspend
  USB: OHCI: Properly handle ohci-at91 suspend
  USB: OHCI: Properly handle ohci-s3c2410 suspend
  USB: OHCI: Properly handle ohci-da8xx suspend
  USB: OHCI: Properly handle ohci-exynos suspend
  USB: OHCI: Properly handle ohci-spear suspend

 drivers/usb/host/ohci-at91.c    |   10 ++++++++--
 drivers/usb/host/ohci-da8xx.c   |   15 +++++++++++----
 drivers/usb/host/ohci-ep93xx.c  |    7 +++++--
 drivers/usb/host/ohci-exynos.c  |   20 +++++---------------
 drivers/usb/host/ohci-hcd.c     |    9 ++++++++-
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 drivers/usb/host/ohci-spear.c   |   12 +++++++++---
 7 files changed, 50 insertions(+), 44 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-10-15 13:19   ` Majunath Goudar
  2013-10-15 15:19     ` Greg KH
  2013-10-15 13:19   ` [PATCH V2 2/7] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
                     ` (5 subsequent siblings)
  6 siblings, 1 reply; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of OHCI was not properly
handled in ochi_suspend()routine. Alan Stern
suggested, properly handle OHCI suspend scenario.

This does generic proper handling of suspend
scenario to all OHCI SOC.

V1->V2:
     - No change. 
       Due to build failure on ep93xx reverted this patch. This patch is 
       needed as Alan mentioned, it is having common ohci suspend features 
       w/o this following patches(still in usb-next) are not useful.

        Commit id "10abfa13"[PATCH 7/11] Properly handle ohci-omap suspend.
        Commit id "39dbd7df"[PATCH 8/11] Properly handle ohci-platform suspend.
        Commit id "4ceaa893"[PATCH 9/11] Properly handle ohci-pxa suspend.
        Commit id "f3c60599"[PATCH 10/11] Properly handle ohci-sm501 suspend.
 

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-hcd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 8ada13f..310bcfe 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1036,6 +1036,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
 	unsigned long	flags;
+	int		rc = 0;
 
 	/* Disable irq emission and mark HW unaccessible. Use
 	 * the spinlock to properly synchronize with possible pending
@@ -1048,7 +1049,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 	spin_unlock_irqrestore (&ohci->lock, flags);
 
-	return 0;
+	synchronize_irq(hcd->irq);
+
+	if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) {
+		ohci_resume(hcd, false);
+		rc = -EBUSY;
+	}
+	return rc;
 }
 EXPORT_SYMBOL_GPL(ohci_suspend);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 2/7] USB: OHCI: Properly handle ohci-at91 suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-10-15 13:19   ` [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
@ 2013-10-15 13:19   ` Majunath Goudar
  2013-10-15 13:19   ` [PATCH V2 3/7] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-at91 glue was not properly handled
as it was not suspending generic part of ohci controller. Alan Stern
suggested, properly handle ohci-at91 suspend scenario.

Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_drv_suspend()
will ensure proper handling of suspend scenario. This task is sugested
by Alan Stern.

V1->V2:
      Due to version mismatch and build failure on ep93xx reverted this patch. 
      This is a proper patch for ohci-at91 suspend as Alan Stern mentioned.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-at91.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 476b5a5..f2d8403 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -636,8 +636,14 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
 	struct usb_hcd	*hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+	bool		do_wakeup = device_may_wakeup(&pdev->dev);
+	int		ret;
 
-	if (device_may_wakeup(&pdev->dev))
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
+	if (do_wakeup)
 		enable_irq_wake(hcd->irq);
 
 	/*
@@ -658,7 +664,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 		at91_stop_clock();
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 3/7] USB: OHCI: Properly handle ohci-s3c2410 suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-10-15 13:19   ` [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
  2013-10-15 13:19   ` [PATCH V2 2/7] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
@ 2013-10-15 13:19   ` Majunath Goudar
  2013-10-15 13:19   ` [PATCH V2 4/7] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 4/7] USB: OHCI: Properly handle ohci-da8xx suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (2 preceding siblings ...)
  2013-10-15 13:19   ` [PATCH V2 3/7] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
@ 2013-10-15 13:19   ` Majunath Goudar
  2013-10-15 13:20   ` [PATCH V2 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-da8xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-da8xx suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_da8xx_suspend() will ensure proper
handling of suspend scenario.

V1->V2:
      -No change.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-da8xx.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 9be59f1..f8238a4 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -406,19 +406,26 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message)
+static int ohci_da8xx_suspend(struct platform_device *pdev,
+				pm_message_t message)
 {
-	struct usb_hcd	*hcd	= platform_get_drvdata(dev);
+	struct usb_hcd	*hcd	= platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci	= hcd_to_ohci(hcd);
+	bool		do_wakeup	= device_may_wakeup(&pdev->dev);
+	int		ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	ohci_da8xx_clock(0);
 	hcd->state = HC_STATE_SUSPENDED;
-	dev->dev.power.power_state = PMSG_SUSPEND;
-	return 0;
+
+	return ret;
 }
 
 static int ohci_da8xx_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (3 preceding siblings ...)
  2013-10-15 13:19   ` [PATCH V2 4/7] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
@ 2013-10-15 13:20   ` Majunath Goudar
  2013-10-15 15:26     ` Alan Stern
  2013-10-15 13:20   ` [PATCH V2 6/7] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
  2013-10-15 13:20   ` [PATCH V2 7/7] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
  6 siblings, 1 reply; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Majunath Goudar <manju.goudar@lge.com>

Suspend scenario in case of ohci-ep93xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-ep93xx suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
suspend scenario.

Signed-off-by: Manjunath Goudar <manju.goudar@lge.com>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org

V1->V2:
   -Fixed Olof Johansson reported build error:
   drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
   drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
   function 'ep93xx_stop_hc'
---
 drivers/usb/host/ohci-ep93xx.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index 492f681..77ebdc8 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -112,12 +112,15 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
 {
 	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(&pdev->dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
-
-	clk_disable(usb_host_clock);
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
 	return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 6/7] USB: OHCI: Properly handle ohci-exynos suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (4 preceding siblings ...)
  2013-10-15 13:20   ` [PATCH V2 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
@ 2013-10-15 13:20   ` Majunath Goudar
  2013-10-15 13:20   ` [PATCH V2 7/7] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
  6 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..aa50e18 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,24 +192,15 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
+	spin_lock_irqsave(&ohci->lock, flags);
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
 
@@ -217,7 +208,6 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V2 7/7] USB: OHCI: Properly handle ohci-spear suspend
  2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (5 preceding siblings ...)
  2013-10-15 13:20   ` [PATCH V2 6/7] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
@ 2013-10-15 13:20   ` Majunath Goudar
  6 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-15 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Manjunath Goudar <manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-spear glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly handle
ohci-spear suspend scenario.

Calling explicitly the ohci_suspend() routine in
spear_ohci_hcd_drv_suspend() will ensure proper
handling of suspend scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-spear.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 31ff3fc..41148f8 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev)
 }
 
 #if defined(CONFIG_PM)
-static int spear_ohci_hcd_drv_suspend(struct platform_device *dev,
+static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev,
 		pm_message_t message)
 {
-	struct usb_hcd *hcd = platform_get_drvdata(dev);
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
 	struct spear_ohci *sohci_p = to_spear_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(&pdev->dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	clk_disable_unprepare(sohci_p->clk);
 
-	return 0;
+	return ret;
 }
 
 static int spear_ohci_hcd_drv_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend
       [not found]               ` <CAKsNYyzFe+o0ctNYyHhL7m71LnAC4WTKbkfN37WHmLBRjgj9+w@mail.gmail.com>
@ 2013-10-15 15:15                 ` Greg KH
  0 siblings, 0 replies; 68+ messages in thread
From: Greg KH @ 2013-10-15 15:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 15, 2013 at 10:34:53AM +0530, manju goudar wrote:
> Alan,
> 
> I am very sorry for this mistake.
> I will fix this issue and sending back series.
> 
> Greg,
> I am really sorry ?:((
> Next time I will not make this kind of mistake.
> If any issue reported related to my patches I will
> fix it and send back to you.?
> Now I am using my personal id to support my patches.

Thanks for continuing to work on this, that's great to hear.  Please
test your patches on all arches that you are modifying, simple build
bugs shouldn't happen.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend
  2013-10-15 13:19   ` [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
@ 2013-10-15 15:19     ` Greg KH
  0 siblings, 0 replies; 68+ messages in thread
From: Greg KH @ 2013-10-15 15:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 15, 2013 at 06:49:56PM +0530, Majunath Goudar wrote:
> From: Manjunath Goudar <manjunath.goudar@linaro.org>
> 
> Suspend scenario in case of OHCI was not properly
> handled in ochi_suspend()routine. Alan Stern
> suggested, properly handle OHCI suspend scenario.
> 
> This does generic proper handling of suspend
> scenario to all OHCI SOC.
> 
> V1->V2:
>      - No change. 
>        Due to build failure on ep93xx reverted this patch. This patch is 
>        needed as Alan mentioned, it is having common ohci suspend features 
>        w/o this following patches(still in usb-next) are not useful.
> 
>         Commit id "10abfa13"[PATCH 7/11] Properly handle ohci-omap suspend.
>         Commit id "39dbd7df"[PATCH 8/11] Properly handle ohci-platform suspend.
>         Commit id "4ceaa893"[PATCH 9/11] Properly handle ohci-pxa suspend.
>         Commit id "f3c60599"[PATCH 10/11] Properly handle ohci-sm501 suspend.
>  
> 
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>

This is an invalid email address, please don't continue to use it, I'm
tired of seeing the bounce response :(

And "v2" for this series?  Really?  I seem to recall many different
versions of the series, so we should be on a much higher number by
now...

How have you tested these patches?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V2 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend
  2013-10-15 13:20   ` [PATCH V2 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
@ 2013-10-15 15:26     ` Alan Stern
  0 siblings, 0 replies; 68+ messages in thread
From: Alan Stern @ 2013-10-15 15:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 15 Oct 2013, Majunath Goudar wrote:

> From: Majunath Goudar <manju.goudar@lge.com>
> 
> Suspend scenario in case of ohci-ep93xx glue was not
> properly handled as it was not suspending generic part
> of ohci controller. Alan Stern suggested, properly handle
> ohci-ep93xx suspend scenario.
> 
> Calling explicitly the ohci_suspend() routine in
> ohci_hcd_ep93xx_drv_suspend() will ensure proper handling of
> suspend scenario.

This patch isn't needed any more.  H Hartley Sweeten has just submitted 
a patch to remove ohci-ep93xx entirely.

Alan Stern

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V3 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
       [not found] ` <1382016913-10872-1-git-send-email-csmanjuvijay@gmail.com>
@ 2013-10-17 13:35     ` Majunath Goudar
  2013-10-17 13:35     ` Majunath Goudar
  1 sibling, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-17 13:35 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: Alan Stern, Greg KH, Ben Dooks, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-usb

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch" and Linaro 
      id bounced. Rewrote this patch on top of latest Greg usb-next 
      branch. This patch not gives any build error. Patch is required 
      for ohci-s3c2410 proper suspending as Alan mentioned.

      Initially when I wrote this patch I was working in Linaro, now 
      I am not part of Linaro that is why Linaro id is bouncing. Sending 
      this patch from personal mail id.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
@ 2013-10-17 13:35     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-17 13:35 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch" and Linaro 
      id bounced. Rewrote this patch on top of latest Greg usb-next 
      branch. This patch not gives any build error. Patch is required 
      for ohci-s3c2410 proper suspending as Alan mentioned.

      Initially when I wrote this patch I was working in Linaro, now 
      I am not part of Linaro that is why Linaro id is bouncing. Sending 
      this patch from personal mail id.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 5/6] USB: OHCI: Properly handle ohci-exynos suspend
       [not found] ` <1382016913-10872-1-git-send-email-csmanjuvijay@gmail.com>
@ 2013-10-17 13:35     ` Majunath Goudar
  2013-10-17 13:35     ` Majunath Goudar
  1 sibling, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-17 13:35 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: Alan Stern, Arnd Bergmann, Greg KH, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-usb

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error. 
      Patch is required for ohci-exynos proper suspending as Alan 
      mentioned.

      Initially when I wrote this patch I was working in Linaro, 
      now I am not part of Linaro that is why Linaro id is bouncing. 
      Sending this patch from personal mail id.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 5/6] USB: OHCI: Properly handle ohci-exynos suspend
@ 2013-10-17 13:35     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-17 13:35 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error. 
      Patch is required for ohci-exynos proper suspending as Alan 
      mentioned.

      Initially when I wrote this patch I was working in Linaro, 
      now I am not part of Linaro that is why Linaro id is bouncing. 
      Sending this patch from personal mail id.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
       [not found] ` <1382094376-31016-1-git-send-email-csmanjuvijay@gmail.com>
@ 2013-10-18 11:06     ` Majunath Goudar
  2013-10-18 11:06     ` Majunath Goudar
  1 sibling, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-18 11:06 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: Greg KH, Ben Dooks, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-usb

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch" and Linaro
      id bounced. Rewrote this patch on top of latest Greg usb-next
      branch. This patch not gives any build error. Patch is required
      for ohci-s3c2410 proper suspending as Alan mentioned.

      Initially when I wrote this patch I was working in Linaro, now
      I am not part of Linaro that is why Linaro id is bouncing. Sending
      this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
@ 2013-10-18 11:06     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-18 11:06 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch" and Linaro
      id bounced. Rewrote this patch on top of latest Greg usb-next
      branch. This patch not gives any build error. Patch is required
      for ohci-s3c2410 proper suspending as Alan mentioned.

      Initially when I wrote this patch I was working in Linaro, now
      I am not part of Linaro that is why Linaro id is bouncing. Sending
      this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 5/6] USB: OHCI: Properly handle ohci-exynos suspend
       [not found] ` <1382094376-31016-1-git-send-email-csmanjuvijay@gmail.com>
@ 2013-10-18 11:06     ` Majunath Goudar
  2013-10-18 11:06     ` Majunath Goudar
  1 sibling, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-18 11:06 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: Arnd Bergmann, Greg KH, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-usb

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error.
      Patch is required for ohci-exynos proper suspending as Alan
      mentioned.

      Initially when I wrote this patch I was working in Linaro,
      now I am not part of Linaro that is why Linaro id is bouncing.
      Sending this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V3 5/6] USB: OHCI: Properly handle ohci-exynos suspend
@ 2013-10-18 11:06     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-18 11:06 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error.
      Patch is required for ohci-exynos proper suspending as Alan
      mentioned.

      Initially when I wrote this patch I was working in Linaro,
      now I am not part of Linaro that is why Linaro id is bouncing.
      Sending this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V4 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
       [not found] ` <1382365136-24472-1-git-send-email-csmanjuvijay@gmail.com>
@ 2013-10-21 14:18     ` Majunath Goudar
  2013-10-21 14:18     ` Majunath Goudar
  1 sibling, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-21 14:18 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: Greg KH, Ben Dooks, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-usb

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
V3->V4:
      -No changes, only added Alan Acked-by.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch" and Linaro
      id bounced. Rewrote this patch on top of latest Greg usb-next
      branch. This patch not gives any build error. Patch is required
      for ohci-s3c2410 proper suspending as Alan mentioned.

      Initially when I wrote this patch I was working in Linaro, now
      I am not part of Linaro that is why Linaro id is bouncing. Sending
      this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V4 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
@ 2013-10-21 14:18     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-21 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
V3->V4:
      -No changes, only added Alan Acked-by.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch" and Linaro
      id bounced. Rewrote this patch on top of latest Greg usb-next
      branch. This patch not gives any build error. Patch is required
      for ohci-s3c2410 proper suspending as Alan mentioned.

      Initially when I wrote this patch I was working in Linaro, now
      I am not part of Linaro that is why Linaro id is bouncing. Sending
      this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V4 5/6] USB: OHCI: Properly handle ohci-exynos suspend
       [not found] ` <1382365136-24472-1-git-send-email-csmanjuvijay@gmail.com>
  2013-10-21 14:18     ` Majunath Goudar
@ 2013-10-21 14:18     ` Majunath Goudar
  1 sibling, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-21 14:18 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: Arnd Bergmann, Greg KH, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-usb

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
V3->V4:
      -No changes, only added Alan Acked-by.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error.
      Patch is required for ohci-exynos proper suspending as Alan
      mentioned.

      Initially when I wrote this patch I was working in Linaro,
      now I am not part of Linaro that is why Linaro id is bouncing.
      Sending this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V4 5/6] USB: OHCI: Properly handle ohci-exynos suspend
@ 2013-10-21 14:18     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-21 14:18 UTC (permalink / raw)
  To: csmanjuvijay
  Cc: linux-samsung-soc, Arnd Bergmann, Greg KH, linux-usb,
	linux-kernel, Kukjin Kim, linux-arm-kernel

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
V3->V4:
      -No changes, only added Alan Acked-by.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error.
      Patch is required for ohci-exynos proper suspending as Alan
      mentioned.

      Initially when I wrote this patch I was working in Linaro,
      now I am not part of Linaro that is why Linaro id is bouncing.
      Sending this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V4 5/6] USB: OHCI: Properly handle ohci-exynos suspend
@ 2013-10-21 14:18     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-10-21 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
V3->V4:
      -No changes, only added Alan Acked-by.

V2->V3:
      -No changes.
      As a build failure on "ep93xx proper suspend patch"
      and Linaro id bounced. Rewrote this patch on top of latest
      Greg usb-next branch. This patch not gives any build error.
      Patch is required for ohci-exynos proper suspending as Alan
      mentioned.

      Initially when I wrote this patch I was working in Linaro,
      now I am not part of Linaro that is why Linaro id is bouncing.
      Sending this patch from personal mail id.

V1->V2:
      -No changes.
       Due to the build failure on ep93xx reverted this patch.
       This patch is needed as Alan Stern suggestion.

 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue
  2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                   ` (15 preceding siblings ...)
       [not found] ` <1382365136-24472-1-git-send-email-csmanjuvijay@gmail.com>
@ 2013-11-13 12:10 ` Majunath Goudar
  2013-11-13 12:10   ` [PATCH V4 1/6] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
                     ` (5 more replies)
  16 siblings, 6 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci bus glue was not properly handled as
it was not suspending generic part of ohci controller. Alan Stern suggested,
properly handle ohci suspend scenario.

Calling explicitly the ohci_suspend()routine will ensure proper handling
of suspend scenario.

This patch set is rebased on greghk/usb-next 3.13-rc1 and successfully 
built without any build error.

V3->V4:
     -Dropped "[PATCH 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend" in
      this version, as H Hartley Sweeten has just submitted a patch to remove
      ohci-ep93xx entirely.

     -[PATCH 2/6] The ohci_suspend() calling after enable_irq_wake, if ohci_suspend
      fails disabling the irq.

     -Added Alan acked-by.


V2->V3:
      -Rewrote the remaining patches on top of the latest Greg usb-next branch.
      This patch set not gives any build error. Patch set is required for proper
      suspend of ohci host controller as Alan mentioned.

      -Initially when I wrote this patch set I was working in Linaro, now I am not
      part of Linaro that is why Linaro id is bouncing. Sending this patch set
      from personal mail id.

V1->V2:
       -This version is fixing the ohci-ep93xx build error reported by Olof Johansson:

        drivers/usb/host/ohci-ep93xx.c: In function 'ohci_hcd_ep93xx_drv_suspend':
        drivers/usb/host/ohci-ep93xx.c:126:2: error: implicit declaration of
        function 'ep93xx_stop_hc'

        Due to the build failure on  "[PATCH 5/11] USB: OHCI: Properly handle
        ohci-ep93xx suspend" following patches were reverted.
        [PATCH 1/11]USB: OHCI: Properly handle OHCI controller suspend
        [PATCH 2/11] USB: OHCI: Properly handle ohci-at91 suspend
        [PATCH 3/11] USB: OHCI: Properly handle ohci-s3c2410 suspend
        [PATCH 4/11] USB: OHCI: Properly handle ohci-da8xx suspend
        [PATCH 5/11] USB: OHCI: Properly handle ohci-ep93xx suspend
        [PATCH 6/11] USB: OHCI: Properly handle ohci-exynos suspend
        [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend

        The following 4 patches are fine and present in usb-next
        Commit id "10abfa13"[PATCH 7/11] Properly handle ohci-omap suspend.
        Commit id "39dbd7df"[PATCH 8/11] Properly handle ohci-platform suspend.
        Commit id "4ceaa893"[PATCH 9/11] Properly handle ohci-pxa suspend.
        Commit id "f3c60599"[PATCH 10/11] Properly handle ohci-sm501 suspend.

        This patch set is working properly.

Majunath Goudar (6):
  USB: OHCI: Properly handle OHCI controller suspend
  USB: OHCI: Properly handle ohci-at91 suspend
  USB: OHCI: Properly handle ohci-s3c2410 suspend
  USB: OHCI: Properly handle ohci-da8xx suspend
  USB: OHCI: Properly handle ohci-exynos suspend
  USB: OHCI: Properly handle ohci-spear suspend

 drivers/usb/host/ohci-at91.c    |   11 +++++++++--
 drivers/usb/host/ohci-da8xx.c   |   16 ++++++++++++----
 drivers/usb/host/ohci-exynos.c  |   22 ++++++----------------
 drivers/usb/host/ohci-hcd.c     |    9 ++++++++-
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 drivers/usb/host/ohci-spear.c   |   12 +++++++++---
 6 files changed, 48 insertions(+), 43 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH V4 1/6] USB: OHCI: Properly handle OHCI controller suspend
  2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-11-13 12:10   ` Majunath Goudar
  2013-11-13 12:10   ` [PATCH 2/6] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of OHCI was not properly
handled in ochi_suspend()routine. Alan Stern
suggested, properly handle OHCI suspend scenario.

This does generic proper handling of suspend
scenario to all OHCI SOC.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by:  Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 V3->V4:
     - No changes, only added Alan Acked-by.

V2->V3 :
     - No changes.
       As a build failure on ep93xx patch, reverted this patch(reveart
       commit id 476e4b). Rewrote this patch on top of latest Greg usb-next
       branch. This patch not gives any build error. patch is required for
       proper suspending as Alan mentioned. It is having common ohci suspend
       features w/o this following patches(still in usb-next) are not useful.

       Commit id "10abfa13"[PATCH 7/11] Properly handle ohci-omap suspend.
       Commit id "39dbd7df"[PATCH 8/11] Properly handle ohci-platform suspend.
       Commit id "4ceaa893"[PATCH 9/11] Properly handle ohci-pxa suspend.
       Commit id "f3c60599"[PATCH 10/11] Properly handle ohci-sm501 suspend.

      Initially when I wrote this patch I was working in Linaro, now I am not
      part of Linaro that is why Linaro id is bouncing. Sending this patch
      from personal mail id.

V1->V2:
     - No change.
       Due to build failure on ep93xx reverted this patch. This patch is
       needed as Alan mentioned, it is having common ohci suspend features
       w/o this following patches(still in usb-next) are not useful.

        Commit id "10abfa13"[PATCH 7/11] Properly handle ohci-omap suspend.
        Commit id "39dbd7df"[PATCH 8/11] Properly handle ohci-platform suspend.
        Commit id "4ceaa893"[PATCH 9/11] Properly handle ohci-pxa suspend.
        Commit id "f3c60599"[PATCH 10/11] Properly handle ohci-sm501 suspend.

 drivers/usb/host/ohci-hcd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 8ada13f..310bcfe 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1036,6 +1036,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
 	unsigned long	flags;
+	int		rc = 0;
 
 	/* Disable irq emission and mark HW unaccessible. Use
 	 * the spinlock to properly synchronize with possible pending
@@ -1048,7 +1049,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 	spin_unlock_irqrestore (&ohci->lock, flags);
 
-	return 0;
+	synchronize_irq(hcd->irq);
+
+	if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) {
+		ohci_resume(hcd, false);
+		rc = -EBUSY;
+	}
+	return rc;
 }
 EXPORT_SYMBOL_GPL(ohci_suspend);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 2/6] USB: OHCI: Properly handle ohci-at91 suspend
  2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
  2013-11-13 12:10   ` [PATCH V4 1/6] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
@ 2013-11-13 12:10   ` Majunath Goudar
  2013-11-13 12:10     ` Majunath Goudar
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-at91 glue was not properly handled
as it was not suspending generic part of ohci controller. Alan Stern
suggested, properly handle ohci-at91 suspend scenario.

Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_drv_suspend()
will ensure proper handling of suspend scenario. This task is sugested
by Alan Stern.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-at91.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 476b5a5..71eff0b 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -636,10 +636,17 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
 	struct usb_hcd	*hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+	bool		do_wakeup = device_may_wakeup(&pdev->dev);
+	int		ret;
 
-	if (device_may_wakeup(&pdev->dev))
+	if (do_wakeup)
 		enable_irq_wake(hcd->irq);
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret) {
+		disable_irq_wake(hcd->irq);
+		return ret;
+	}
 	/*
 	 * The integrated transceivers seem unable to notice disconnect,
 	 * reconnect, or wakeup without the 48 MHz clock active.  so for
@@ -658,7 +665,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 		at91_stop_clock();
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
  2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-11-13 12:10     ` Majunath Goudar
  2013-11-13 12:10   ` [PATCH 2/6] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-samsung-soc, Greg KH, linux-usb, linux-kernel,
	Majunath Goudar, Ben Dooks, Kukjin Kim, nataraja.km

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 3/6]  USB: OHCI: Properly handle ohci-s3c2410 suspend
@ 2013-11-13 12:10     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-s3c2410 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-s3c2410 suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_hcd_s3c2410_drv_suspend() will ensure
proper handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-s3c2410.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index be3429e..b5bf9b7 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -426,28 +426,15 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
 static int ohci_hcd_s3c2410_drv_suspend(struct device *dev)
 {
 	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
-	unsigned long flags;
+	bool do_wakeup = device_may_wakeup(dev);
 	int rc = 0;
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED) {
-		rc = -EINVAL;
-		goto bail;
-	}
-
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	rc = ohci_suspend(hcd, do_wakeup);
+	if (rc)
+		return rc;
 
 	s3c2410_stop_hc(pdev);
-bail:
-	spin_unlock_irqrestore(&ohci->lock, flags);
 
 	return rc;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 4/6] USB: OHCI: Properly handle ohci-da8xx suspend
  2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (2 preceding siblings ...)
  2013-11-13 12:10     ` Majunath Goudar
@ 2013-11-13 12:10   ` Majunath Goudar
  2013-11-13 12:10     ` Majunath Goudar
  2013-11-13 12:10   ` [PATCH 6/6] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
  5 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-da8xx glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-da8xx suspend scenario.

Calling explicitly the ohci_suspend()
routine in ohci_da8xx_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.or
---
 drivers/usb/host/ohci-da8xx.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 9be59f1..71dbd85 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -406,19 +406,27 @@ static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message)
+static int ohci_da8xx_suspend(struct platform_device *pdev,
+				pm_message_t message)
 {
-	struct usb_hcd	*hcd	= platform_get_drvdata(dev);
+	struct usb_hcd	*hcd	= platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci	= hcd_to_ohci(hcd);
+	bool		do_wakeup	= device_may_wakeup(&pdev->dev);
+	int		ret;
+
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	ohci_da8xx_clock(0);
 	hcd->state = HC_STATE_SUSPENDED;
-	dev->dev.power.power_state = PMSG_SUSPEND;
-	return 0;
+
+	return ret;
 }
 
 static int ohci_da8xx_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 5/6] USB: OHCI: Properly handle ohci-exynos suspend
  2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
@ 2013-11-13 12:10     ` Majunath Goudar
  2013-11-13 12:10   ` [PATCH 2/6] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-samsung-soc, Arnd Bergmann, Greg KH, linux-usb,
	linux-kernel, Majunath Goudar, Kukjin Kim, nataraja.km

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 5/6] USB: OHCI: Properly handle ohci-exynos suspend
@ 2013-11-13 12:10     ` Majunath Goudar
  0 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-exynos glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-exynos suspend scenario.

Calling explicitly the ohci_suspend() routine in
exynos_ohci_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-exynos.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index a87baed..4b5c8bd 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -192,23 +192,14 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	struct platform_device *pdev = to_platform_device(dev);
+	bool do_wakeup = device_may_wakeup(dev);
 	unsigned long flags;
-	int rc = 0;
+	int rc = ohci_suspend(hcd, do_wakeup);
 
-	/*
-	 * Root hub was already suspended. Disable irq emission and
-	 * mark HW unaccessible, bail out if RH has been resumed. Use
-	 * the spinlock to properly synchronize with possible pending
-	 * RH suspend or resume activity.
-	 */
-	spin_lock_irqsave(&ohci->lock, flags);
-	if (ohci->rh_state != OHCI_RH_SUSPENDED &&
-			ohci->rh_state != OHCI_RH_HALTED) {
-		rc = -EINVAL;
-		goto fail;
-	}
+	if (rc)
+		return rc;
 
-	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+	spin_lock_irqsave(&ohci->lock, flags);
 
 	if (exynos_ohci->otg)
 		exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
@@ -217,10 +208,9 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
-fail:
 	spin_unlock_irqrestore(&ohci->lock, flags);
 
-	return rc;
+	return 0;
 }
 
 static int exynos_ohci_resume(struct device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 6/6] USB: OHCI: Properly handle ohci-spear suspend
  2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
                     ` (4 preceding siblings ...)
  2013-11-13 12:10     ` Majunath Goudar
@ 2013-11-13 12:10   ` Majunath Goudar
  5 siblings, 0 replies; 68+ messages in thread
From: Majunath Goudar @ 2013-11-13 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Suspend scenario in case of ohci-spear glue was not
properly handled as it was not suspending generic part
of ohci controller.  Alan Stern suggested, properly handle
ohci-spear suspend scenario.

Calling explicitly the ohci_suspend() routine in
spear_ohci_hcd_drv_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci-spear.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 31ff3fc..41148f8 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev)
 }
 
 #if defined(CONFIG_PM)
-static int spear_ohci_hcd_drv_suspend(struct platform_device *dev,
+static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev,
 		pm_message_t message)
 {
-	struct usb_hcd *hcd = platform_get_drvdata(dev);
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
 	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
 	struct spear_ohci *sohci_p = to_spear_ohci(hcd);
+	bool do_wakeup = device_may_wakeup(&pdev->dev);
+	int ret;
 
 	if (time_before(jiffies, ohci->next_statechange))
 		msleep(5);
 	ohci->next_statechange = jiffies;
 
+	ret = ohci_suspend(hcd, do_wakeup);
+	if (ret)
+		return ret;
+
 	clk_disable_unprepare(sohci_p->clk);
 
-	return 0;
+	return ret;
 }
 
 static int spear_ohci_hcd_drv_resume(struct platform_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2013-11-13 12:10 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-02 10:15 [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
2013-10-02 10:15 ` [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 02/11] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
2013-10-14 15:49   ` Olof Johansson
2013-10-14 20:34     ` Alan Stern
2013-10-14 20:41       ` Greg KH
2013-10-14 20:42       ` Hartley Sweeten
2013-10-14 20:50         ` Alan Stern
2013-10-14 21:07           ` Hartley Sweeten
2013-10-15  4:32             ` Olof Johansson
     [not found]               ` <CAKsNYyzFe+o0ctNYyHhL7m71LnAC4WTKbkfN37WHmLBRjgj9+w@mail.gmail.com>
2013-10-15 15:15                 ` Greg KH
2013-10-02 10:15 ` [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-10-02 11:34   ` Bartlomiej Zolnierkiewicz
2013-10-02 14:38     ` Alan Stern
2013-10-02 15:10       ` Bartlomiej Zolnierkiewicz
2013-10-02 15:52         ` Alan Stern
2013-10-02 10:15 ` [PATCH 07/11] USB: OHCI: Properly handle ohci-omap suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 08/11] USB: OHCI: Properly handle ohci-platform suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Majunath Goudar
2013-10-02 10:15 ` [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
2013-10-03 13:02 ` [PATCH V2 00/11] USB: OHCI :Properly handle ohci_suspend()routine in bus glue Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 01/11] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 02/11] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 06/11] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 07/11] USB: OHCI: Properly handle ohci-omap suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 08/11] USB: OHCI: Properly handle ohci-platform suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Majunath Goudar
2013-10-03 13:02   ` [PATCH V2 11/11] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
2013-10-15 13:19 ` [PATCH V2 0/7] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
2013-10-15 13:19   ` [PATCH V2 1/7] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
2013-10-15 15:19     ` Greg KH
2013-10-15 13:19   ` [PATCH V2 2/7] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
2013-10-15 13:19   ` [PATCH V2 3/7] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-10-15 13:19   ` [PATCH V2 4/7] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
2013-10-15 13:20   ` [PATCH V2 5/7] USB: OHCI: Properly handle ohci-ep93xx suspend Majunath Goudar
2013-10-15 15:26     ` Alan Stern
2013-10-15 13:20   ` [PATCH V2 6/7] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-10-15 13:20   ` [PATCH V2 7/7] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar
     [not found] ` <1382016913-10872-1-git-send-email-csmanjuvijay@gmail.com>
2013-10-17 13:35   ` [PATCH V3 3/6] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-10-17 13:35     ` Majunath Goudar
2013-10-17 13:35   ` [PATCH V3 5/6] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-10-17 13:35     ` Majunath Goudar
     [not found] ` <1382094376-31016-1-git-send-email-csmanjuvijay@gmail.com>
2013-10-18 11:06   ` [PATCH V3 3/6] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-10-18 11:06     ` Majunath Goudar
2013-10-18 11:06   ` [PATCH V3 5/6] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-10-18 11:06     ` Majunath Goudar
     [not found] ` <1382365136-24472-1-git-send-email-csmanjuvijay@gmail.com>
2013-10-21 14:18   ` [PATCH V4 3/6] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-10-21 14:18     ` Majunath Goudar
2013-10-21 14:18   ` [PATCH V4 5/6] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-10-21 14:18     ` Majunath Goudar
2013-10-21 14:18     ` Majunath Goudar
2013-11-13 12:10 ` [PATCH V4 0/6]USB: OHCI:Properly handle ohci_suspend()routine in bus glue Majunath Goudar
2013-11-13 12:10   ` [PATCH V4 1/6] USB: OHCI: Properly handle OHCI controller suspend Majunath Goudar
2013-11-13 12:10   ` [PATCH 2/6] USB: OHCI: Properly handle ohci-at91 suspend Majunath Goudar
2013-11-13 12:10   ` [PATCH 3/6] USB: OHCI: Properly handle ohci-s3c2410 suspend Majunath Goudar
2013-11-13 12:10     ` Majunath Goudar
2013-11-13 12:10   ` [PATCH 4/6] USB: OHCI: Properly handle ohci-da8xx suspend Majunath Goudar
2013-11-13 12:10   ` [PATCH 5/6] USB: OHCI: Properly handle ohci-exynos suspend Majunath Goudar
2013-11-13 12:10     ` Majunath Goudar
2013-11-13 12:10   ` [PATCH 6/6] USB: OHCI: Properly handle ohci-spear suspend Majunath Goudar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.