USB: OHCI:Properly handle ohci_suspend()routine in bus glue
Subsystems (5)
cover USB: OHCI:Properly handle ohci_suspend()routine in bus glue
From: Manjunath Goudar <[email protected]>
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(-)
Signature · 1 line
1.7.9.5
PATCH 1/11 USB: OHCI: Properly handle OHCI controller suspend
From: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-hcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-hcd.c +8 -1
@@ -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);
Signature · 1 line
1.7.9.5
PATCH 2/11 USB: OHCI: Properly handle ohci-at91 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-at91.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +8 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 3/11 USB: OHCI: Properly handle ohci-s3c2410 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-s3c2410.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
drivers/usb/host/ohci-s3c2410.c +4 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH 4/11 USB: OHCI: Properly handle ohci-da8xx suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-da8xx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/usb/host/ohci-da8xx.c +11 -4
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-ep93xx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-ep93xx.c +9 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Hi, Greg,
[Adding ep93xx maintainers as well]
Quoted 36 lines · Majunath Goudar
From: Manjunath Goudar <[email protected]>
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 inohci_hcd_ep93xx_drv_suspend()will ensure proper handling of suspend scenario.Signed-off-by Manjunath Goudar <[email protected]>Signed-off-by Manjunath Goudar <[email protected]>Acked-by Alan Stern <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Greg KH <[email protected]>Cc linux-usb at vger.kernel.org--- drivers/usb/host/ohci-ep93xx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/usb/host/ohci-ep93xx.c +2
-0@@ -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;
drivers/usb/host/ohci-ep93xx.c static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ · line 129
Quoted 10 lines
drivers/usb/host/ohci-ep93xx.c +7
-2-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:
Quoted 1 line
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
Alan Stern
maintainerPATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 50 lines · Olof Johansson
Hi, Greg,
[Adding ep93xx maintainers as well]
Quoted 24 lines · Majunath Goudar
From: Manjunath Goudar <[email protected]>
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 inohci_hcd_ep93xx_drv_suspend()will ensure proper handling of suspend scenario.drivers/usb/host/ohci-ep93xx.c +2
-0@@ -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;drivers/usb/host/ohci-ep93xx.c static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ · line 129
Quoted 10 lines
drivers/usb/host/ohci-ep93xx.c +7
-2-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:
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'
Quoted 5 lines
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.
Quoted 1 line
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
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 65 lines · Alan Stern
Quoted 50 lines · Olof Johansson
Hi, Greg,
[Adding ep93xx maintainers as well]
Quoted 24 lines · Majunath Goudar
From: Manjunath Goudar <[email protected]>
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 inohci_hcd_ep93xx_drv_suspend()will ensure proper handling of suspend scenario.drivers/usb/host/ohci-ep93xx.c +2
-0@@ -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;drivers/usb/host/ohci-ep93xx.c static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ · line 129
Quoted 10 lines
drivers/usb/host/ohci-ep93xx.c +7
-2-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:
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'Quoted 5 lines
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.
Quoted 7 lines
But commit
af3f233fd27b(usb: ohci-ep93xx: tidy up driver (*probe) and (*remove)), dated July 1, removed it. Manjunath never updated his patch in response.Quoted 1 line
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
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
In reply to Alan SternQuoted 65 lines · Alan Stern
Quoted 50 lines · Olof Johansson
Hi, Greg,
[Adding ep93xx maintainers as well]
Quoted 24 lines · Majunath Goudar
From: Manjunath Goudar <[email protected]>
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 inohci_hcd_ep93xx_drv_suspend()will ensure proper handling of suspend scenario.drivers/usb/host/ohci-ep93xx.c +2
-0@@ -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;drivers/usb/host/ohci-ep93xx.c static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_ · line 129
Quoted 10 lines
drivers/usb/host/ohci-ep93xx.c +7
-2-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:
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'Quoted 5 lines
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.
Quoted 7 lines
But commit
af3f233fd27b(usb: ohci-ep93xx: tidy up driver (*probe) and
(*remove)), dated July 1, removed it. Manjunath never updated his
patch in response.Quoted 1 line
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
Alan Stern
maintainerPATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 8 lines · Hartley Sweeten
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
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 10 lines · Alan Stern
Quoted 6 lines · Hartley Sweeten
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
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 12 lines · Hartley Sweeten
Quoted 10 lines · Alan Stern
Quoted 6 lines · Hartley Sweeten
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!
Quoted 8 lines
The only thing I'm not sure about use where to enable the
USB_OHCI_HCD_PLATFORMdriver forARCH_EP93XX.Right now the ohci-ep93xx glue driver is enabled automatically when
USB_OHCI_HCDis enabled due to the ifdefery. I can add a new config option similar to the other users ofUSB_OHCI_HCD_PLATFORMbut 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
A message that is not in the archive (sent off-list or not yet received): CAKsNYyzFe+o0ctNYyHhL7m71LnAC4WTKbkfN37WHmLBRjgj9+w@mail.gmail.com
PATCH 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 11 lines · manju goudar
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
PATCH 6/11 USB: OHCI: Properly handle ohci-exynos suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-exynos.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/usb/host/ohci-exynos.c +5 -15
@@ -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;
Signature · 1 line
1.7.9.5
PATCH 6/11 USB: OHCI: Properly handle ohci-exynos suspend
Hi,
Quoted 38 lines · Majunath Goudar
From: Manjunath Goudar <[email protected]>
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 inexynos_ohci_suspend()will ensure proper handling of suspend scenario.Signed-off-by Manjunath Goudar <[email protected]>Signed-off-by Manjunath Goudar <[email protected]>Acked-by Alan Stern <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Greg KH <[email protected]>Cc linux-usb at vger.kernel.org--- drivers/usb/host/ohci-exynos.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)drivers/usb/host/ohci-exynos.c +1
-5@@ -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.
drivers/usb/host/ohci-exynos.c static int exynos_ohci_suspend(struct device *dev) · line 210
Quoted 10 lines
drivers/usb/host/ohci-exynos.c +1
-9-*/ -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?
Quoted 8 lines
drivers/usb/host/ohci-exynos.c +3
-0+if (rc) +return rc; +spin_lock_irqsave (&ohci->lock, flags);if (exynos_ohci->otg) exynos_ohci->otg->set_host (exynos_ohci->otg, &hcd->self);
drivers/usb/host/ohci-exynos.c static int exynos_ohci_suspend(struct device *dev) · line 224
Quoted 7 lines
drivers/usb/host/ohci-exynos.c +0
-1@@ -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
Alan Stern
maintainerPATCH 6/11 USB: OHCI: Properly handle ohci-exynos suspend
Quoted 2 lines · Bartlomiej Zolnierkiewicz
Maybe it would make sense to cleanup
ohci_suspend()first (before adding newohci_suspend()users) and remove unuseddo_wakeupparameter?
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
PATCH 6/11 USB: OHCI: Properly handle ohci-exynos suspend
Hi,
Quoted 8 lines · Alan Stern
Quoted 2 lines · Bartlomiej Zolnierkiewicz
Maybe it would make sense to cleanup
ohci_suspend()first (before adding newohci_suspend()users) and remove unuseddo_wakeupparameter?Not possible. The
do_wakeupparameter is part of a function prototype shared by other callback routines (such asehci_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
Alan Stern
maintainerPATCH 6/11 USB: OHCI: Properly handle ohci-exynos suspend
Quoted 17 lines · Bartlomiej Zolnierkiewicz
Hi,
Quoted 8 lines · Alan Stern
Quoted 2 lines · Bartlomiej Zolnierkiewicz
Maybe it would make sense to cleanup
ohci_suspend()first (before adding newohci_suspend()users) and remove unuseddo_wakeupparameter?Not possible. The
do_wakeupparameter is part of a function prototype shared by other callback routines (such asehci_suspend()) that _do_ use the parameter.If you mean
ohci-pci.cusage (which is currently the only usage ofohci_suspend()looking at the latest -next kernel) than it is enough to add a simple wrapper for it inohci-pci.c:
Quoted 8 lines
...
static intohci_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
PATCH 7/11 USB: OHCI: Properly handle ohci-omap suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-omap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-omap.c +10 -3
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 8/11 USB: OHCI: Properly handle ohci-platform suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-platform.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-platform.c +9 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 9/11 USB: OHCI: Properly handle ohci-pxa27x suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-pxa27x.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-pxa27x.c +8 -1
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 10/11 USB: OHCI: Properly handle ohci-sm501 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-sm501.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-sm501.c +9 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 11/11 USB: OHCI: Properly handle ohci-spear suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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 inspear_ohci_hcd_drv_suspend() will ensure proper
handling of suspend scenario.
--- drivers/usb/host/ohci-spear.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-spear.c +9 -3
@@ -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)
Signature · 1 line
1.7.9.5
v2 cover USB: OHCI :Properly handle ohci_suspend()routine in bus glue
In reply to Majunath GoudarSuspend 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(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/11 USB: OHCI: Properly handle OHCI controller suspend
From: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-hcd.c | 11 +++++++++-- drivers/usb/host/ohci.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-hcd.c +9 -2
@@ -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);
drivers/usb/host/ohci.h +1 -1
@@ -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
Signature · 1 line
1.7.9.5
PATCH v2 2/11 USB: OHCI: Properly handle ohci-at91 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-at91.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-at91.c +5 -3
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 3/11 USB: OHCI: Properly handle ohci-s3c2410 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-s3c2410.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
drivers/usb/host/ohci-s3c2410.c +3 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH v2 4/11 USB: OHCI: Properly handle ohci-da8xx suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-da8xx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/usb/host/ohci-da8xx.c +10 -4
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 5/11 USB: OHCI: Properly handle ohci-ep93xx suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-ep93xx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-ep93xx.c +8 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 6/11 USB: OHCI: Properly handle ohci-exynos suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-exynos.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/usb/host/ohci-exynos.c +4 -15
@@ -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;
Signature · 1 line
1.7.9.5
PATCH v2 7/11 USB: OHCI: Properly handle ohci-omap suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-omap.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-omap.c +9 -3
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 8/11 USB: OHCI: Properly handle ohci-platform suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-platform.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-platform.c +8 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 9/11 USB: OHCI: Properly handle ohci-pxa27x suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-pxa27x.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-pxa27x.c +7 -1
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 10/11 USB: OHCI: Properly handle ohci-sm501 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-sm501.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-sm501.c +8 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 11/11 USB: OHCI: Properly handle ohci-spear suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-spear.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-spear.c +8 -3
@@ -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)
Signature · 1 line
1.7.9.5
v2 cover USB: OHCI:Properly handle ohci_suspend()routine in bus glue
In reply to Majunath GoudarFrom: Majunath Goudar <[email protected]>
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(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/7 USB: OHCI: Properly handle OHCI controller suspend
From: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-hcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-hcd.c +8 -1
@@ -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);
Signature · 1 line
1.7.9.5
Greg KH
maintainerPATCH v2 1/7 USB: OHCI: Properly handle OHCI controller suspend
Quoted 15 lines · Majunath Goudar
From: Manjunath Goudar <[email protected]>
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.
Quoted 7 lines
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 <[email protected]>
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
PATCH v2 2/7 USB: OHCI: Properly handle ohci-at91 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-at91.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +8 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 3/7 USB: OHCI: Properly handle ohci-s3c2410 suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-s3c2410.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
drivers/usb/host/ohci-s3c2410.c +4 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH v2 4/7 USB: OHCI: Properly handle ohci-da8xx suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-da8xx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/usb/host/ohci-da8xx.c +11 -4
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v2 5/7 USB: OHCI: Properly handle ohci-ep93xx suspend
In reply to Majunath GoudarFrom: Majunath Goudar <[email protected]>
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.
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(-)
drivers/usb/host/ohci-ep93xx.c +5 -2
@@ -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 ; }
Signature · 1 line
1.7.9.5
Alan Stern
maintainerPATCH v2 5/7 USB: OHCI: Properly handle ohci-ep93xx suspend
Quoted 10 lines · Majunath Goudar
From: Majunath Goudar <[email protected]>
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 inohci_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
PATCH v2 6/7 USB: OHCI: Properly handle ohci-exynos suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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.
--- drivers/usb/host/ohci-exynos.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/usb/host/ohci-exynos.c +5 -15
@@ -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;
Signature · 1 line
1.7.9.5
PATCH v2 7/7 USB: OHCI: Properly handle ohci-spear suspend
In reply to Majunath GoudarFrom: Manjunath Goudar <[email protected]>
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 inspear_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.
--- drivers/usb/host/ohci-spear.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-spear.c +9 -3
@@ -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)
Signature · 1 line
1.7.9.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 3/6 USB: OHCI: Properly handle ohci-s3c2410 suspend
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.
--- drivers/usb/host/ohci-s3c2410.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
drivers/usb/host/ohci-s3c2410.c +4 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH v3 5/6 USB: OHCI: Properly handle ohci-exynos suspend
In reply to a message not in the archiveSuspend 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.
--- drivers/usb/host/ohci-exynos.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
drivers/usb/host/ohci-exynos.c +6 -16
@@ -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)
Signature · 1 line
1.7.9.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 3/6 USB: OHCI: Properly handle ohci-s3c2410 suspend
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.
---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(-)
drivers/usb/host/ohci-s3c2410.c +4 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH v3 5/6 USB: OHCI: Properly handle ohci-exynos suspend
In reply to a message not in the archiveSuspend 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.
---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(-)
drivers/usb/host/ohci-exynos.c +6 -16
@@ -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)
Signature · 1 line
1.7.9.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v4 3/6 USB: OHCI: Properly handle ohci-s3c2410 suspend
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.
---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(-)
drivers/usb/host/ohci-s3c2410.c +4 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH v4 5/6 USB: OHCI: Properly handle ohci-exynos suspend
In reply to a message not in the archiveSuspend 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.
---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(-)
drivers/usb/host/ohci-exynos.c +6 -16
@@ -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)
Signature · 1 line
1.7.9.5
v4 cover USB: OHCI:Properly handle ohci_suspend()routine in bus glue
In reply to Majunath GoudarSuspend 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(-)
Signature · 1 line
1.7.9.5
PATCH v4 1/6 USB: OHCI: Properly handle OHCI controller suspend
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.
---
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(-)
drivers/usb/host/ohci-hcd.c +8 -1
@@ -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);
Signature · 1 line
1.7.9.5
PATCH v4 2/6 USB: OHCI: Properly handle ohci-at91 suspend
In reply to Majunath GoudarSuspend 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.
--- drivers/usb/host/ohci-at91.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +9 -2
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v4 3/6 USB: OHCI: Properly handle ohci-s3c2410 suspend
In reply to Majunath GoudarSuspend 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.
--- drivers/usb/host/ohci-s3c2410.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
drivers/usb/host/ohci-s3c2410.c +4 -17
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH v4 4/6 USB: OHCI: Properly handle ohci-da8xx suspend
In reply to Majunath GoudarSuspend 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.
--- drivers/usb/host/ohci-da8xx.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/usb/host/ohci-da8xx.c +12 -4
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v4 5/6 USB: OHCI: Properly handle ohci-exynos suspend
In reply to Majunath GoudarSuspend 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.
--- drivers/usb/host/ohci-exynos.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
drivers/usb/host/ohci-exynos.c +6 -16
@@ -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)
Signature · 1 line
1.7.9.5
PATCH v4 6/6 USB: OHCI: Properly handle ohci-spear suspend
In reply to Majunath GoudarSuspend 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.
--- drivers/usb/host/ohci-spear.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-spear.c +9 -3
@@ -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)
Signature · 1 line
1.7.9.5