Suspend scenario in case of ohci bus glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend()routine will ensure proper handling of suspend scenario.
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3: -New patch 1/11 added, for generic ohci-hcd suspend code.
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 | 17 ++++++++++++----- drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- drivers/usb/host/ohci-exynos.c | 24 +++++++----------------- drivers/usb/host/ohci-hcd.c | 9 ++++++++- drivers/usb/host/ohci-omap.c | 13 ++++++++++--- drivers/usb/host/ohci-platform.c | 9 ++++++++- drivers/usb/host/ohci-pxa27x.c | 8 +++++++- drivers/usb/host/ohci-s3c2410.c | 19 ++++--------------- drivers/usb/host/ohci-sm501.c | 11 +++++++++-- drivers/usb/host/ohci-spear.c | 12 +++++++++--- 11 files changed, 91 insertions(+), 51 deletions(-)
Suspend scenario in case of OHCI was not properly handled in ochi_suspend()routine. This does proper handling of suspend scenario.
Signed-off-by: Manjunath Goudar manjunath.goudar@linaro.org Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V3: New patch. --- 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 b69a49e..f3dcaa2 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1034,6 +1034,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 @@ -1046,7 +1047,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);
Suspend scenario in case of ohci-at91 glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_drv_suspend() will ensure proper handling of suspend scenario.
Signed-off-by: Manjunath Goudar manjunath.goudar@linaro.org Acked-by: Alan Stern stern@rowland.harvard.edu Cc: Arnd Bergmann arnd@arndb.de Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3: -Aligned variable "do_wakeup" and "ret". --- 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 fb2f127..e34baa6 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -619,8 +619,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);
/* @@ -637,7 +643,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)
Suspend scenario in case of ohci-s3c2410 glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. --- drivers/usb/host/ohci-s3c2410.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 8018bb1..70a7ca1 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -428,26 +428,15 @@ 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); + 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) { - 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; }
Suspend scenario in case of ohci-da8xx glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". -pdev->dev.power.power_state stuff has been removed. --- drivers/usb/host/ohci-da8xx.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 6aaa9c9..78a6124 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->next_statechange = jiffies; 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)
Suspend scenario in case of ohci-ep93xx glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 8704e9f..f5f11d1 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -174,13 +174,21 @@ 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); + + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + ohci->next_statechange = jiffies;
ep93xx_stop_hc(&pdev->dev); - return 0; + + return ret; }
static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
Hello.
On 19-06-2013 16:12, Manjunath Goudar wrote:
Suspend scenario in case of ohci-ep93xx glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3:
-Aligned variable "do_wakeup" and "ret".
drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 8704e9f..f5f11d1 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -174,13 +174,21 @@ 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;
There was no need to use tabs here, didn't you see that here the variables aren't aligned?
WBR, Sergei
On 19 June 2013 18:13, Sergei Shtylyov sergei.shtylyov@cogentembedded.comwrote:
Hello.
On 19-06-2013 16:12, Manjunath Goudar wrote:
Suspend scenario in case of ohci-ep93xx glue was not
properly handled as it was not suspending generic part of ohci controller. 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
Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2:
-Incase ohci_suspend() fails, return right away without executing further. V3:
-Aligned variable "do_wakeup" and "ret".
drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-**ep93xx.c b/drivers/usb/host/ohci-**
ep93xx.c index 8704e9f..f5f11d1 100644 --- a/drivers/usb/host/ohci-**ep93xx.c +++ b/drivers/usb/host/ohci-**ep93xx.c @@ -174,13 +174,21 @@ 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;
There was no need to use tabs here, didn't you see that here the variables aren't aligned?
WBR, Sergei
Instead of gmail you can use thunderbird mail there it is showing proper
alignment.
Manjunath Goudar
On 19 June 2013 20:12, Manjunath Goudar manjunath.goudar@linaro.org wrote:
On 19 June 2013 18:13, Sergei Shtylyov sergei.shtylyov@cogentembedded.com
On 19-06-2013 16:12, Manjunath Goudar wrote:
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;
There was no need to use tabs here, didn't you see that here the variables aren't aligned?
Instead of gmail you can use thunderbird mail there it is showing proper alignment.
First try to understand what the actual comment is. He isn't complaining about bad alignment but as hcd and ohci aren't aligned with tabs, you don't require to add tabs to do_wakeup and ret.
-- viresh
Hello.
On 06/19/2013 06:42 PM, Manjunath Goudar wrote:
Suspend scenario in case of ohci-ep93xx glue was not properly handled as it was not suspending generic part of ohci controller. 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 <mailto:manjunath.goudar@linaro.org>> Cc: Arnd Bergmann <arnd@arndb.de <mailto:arnd@arndb.de>> Cc: Alan Stern <stern@rowland.harvard.edu <mailto:stern@rowland.harvard.edu>> Cc: Greg KH <greg@kroah.com <mailto:greg@kroah.com>> Cc: linux-usb@vger.kernel.org <mailto:linux-usb@vger.kernel.org> V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-__ep93xx.c b/drivers/usb/host/ohci-__ep93xx.c index 8704e9f..f5f11d1 100644 --- a/drivers/usb/host/ohci-__ep93xx.c +++ b/drivers/usb/host/ohci-__ep93xx.c @@ -174,13 +174,21 @@ 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;
There was no need to use tabs here, didn't you see that here the variables aren't aligned?
WBR, Sergei
Instead of gmail you can use thunderbird mail there it is showing proper alignment.
Imagine, I'm using Thinderbird. :-D And you're using HTML reply format, unwelcome on the Linux mailing lists.
Manjunath Goudar
WBR, Sergei
On 19 June 2013 23:03, Sergei Shtylyov sergei.shtylyov@cogentembedded.comwrote:
Hello.
On 06/19/2013 06:42 PM, Manjunath Goudar wrote:
Suspend scenario in case of ohci-ep93xx glue was not
properly handled as it was not suspending generic part of ohci controller. 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 <mailto:manjunath.goudar@**linaro.org<manjunath.goudar@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de <mailto:arnd@arndb.de>> Cc: Alan Stern <stern@rowland.harvard.edu <mailto:stern@rowland.harvard.**edu <stern@rowland.harvard.edu>>> Cc: Greg KH <greg@kroah.com <mailto:greg@kroah.com>> Cc: linux-usb@vger.kernel.org <mailto:linux-usb@vger.kernel.**org<linux-usb@vger.kernel.org>
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-ep93xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-__**ep93xx.c b/drivers/usb/host/ohci-__**ep93xx.c index 8704e9f..f5f11d1 100644 --- a/drivers/usb/host/ohci-__**ep93xx.c +++ b/drivers/usb/host/ohci-__**ep93xx.c @@ -174,13 +174,21 @@ 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;
There was no need to use tabs here, didn't you see that here the
variables aren't aligned?
WBR, Sergei
Instead of gmail you can use thunderbird mail there it is showing
proper alignment.
Imagine, I'm using Thinderbird. :-D And you're using HTML reply format, unwelcome on the Linux mailing lists.
Manjunath Goudar
I am very sorry Sergei.I really misunderstanding your comments.I will fix your comments in next version.
Manjunath Goudar
WBR, Sergei
Suspend scenario in case of ohci-exynos glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-exynos.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index ae6068d..b5926f8 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); - unsigned long flags; - int rc = 0; + 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;
On 19-06-2013 16:12, Manjunath Goudar wrote:
Suspend scenario in case of ohci-exynos glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it.
-Aligned variable "do_wakeup" and "ret".
drivers/usb/host/ohci-exynos.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index ae6068d..b5926f8 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);
- unsigned long flags;
- int rc = 0;
- bool do_wakeup = device_may_wakeup(dev);
- unsigned long flags;
- int rc = 0;
Sigh, here there was no any alignment of variable names, why you aligned your variables? Doing everything with the single template? :-)
WBR, Sergei
Suspend scenario in case of ohci-omap glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3: -Aligned variable "do_wakeup" and "ret". --- 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 10ba58d..4bd1e8f 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -432,16 +432,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)
Suspend scenario in case of ohci-platform glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-platform.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index bc30475..f4830a5 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_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)
On 19-06-2013 16:12, Manjunath Goudar wrote:
Suspend scenario in case of ohci-platform glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further.
V3:
-Aligned variable "do_wakeup" and "ret".
drivers/usb/host/ohci-platform.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index bc30475..f4830a5 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_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);
Again, the above variables weren't aligned. I bet you were just cut-and-pasting the same code without looking... :-/
- bool do_wakeup = device_may_wakeup(dev);
- int ret;
WBR, Sergei
Suspend scenario in case of ohci-pxa27x glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- 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 3a9c01d..1dc2a72 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -564,13 +564,19 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd); + bool do_wakeup = device_may_wakeup(dev); + int ret;
if (time_before(jiffies, ohci->ohci.next_statechange)) msleep(5); ohci->ohci.next_statechange = jiffies;
+ ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + pxa27x_stop_hc(ohci, dev); - return 0; + return ret; }
static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
On 19-06-2013 16:12, Manjunath Goudar wrote:
Suspend scenario in case of ohci-pxa27x glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3:
-Aligned variable "do_wakeup" and "ret".
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 3a9c01d..1dc2a72 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -564,13 +564,19 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd);
- bool do_wakeup = device_may_wakeup(dev);
- int ret;
And again, no variable name alignment was needed.
WBR, Sergei
Suspend scenario in case of ohci-sm501 glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- 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..e6c8db6 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)
Suspend scenario in case of ohci-spear glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- 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..a3b2696 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)
On 19-06-2013 16:12, Manjunath Goudar wrote:
Suspend scenario in case of ohci-spear glue was not properly handled as it was not suspending generic part of ohci controller. 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 Cc: Arnd Bergmann arnd@arndb.de Cc: Alan Stern stern@rowland.harvard.edu Cc: Greg KH greg@kroah.com Cc: linux-usb@vger.kernel.org
V2: -Incase ohci_suspend() fails, return right away without executing further. V3:
-Aligned variable "do_wakeup" and "ret".
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..a3b2696 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;
Sigh...
WBR, Sergei
linaro-kernel@lists.linaro.org