All of lore.kernel.org
 help / color / mirror / Atom feed
From: manjunath.goudar@linaro.org (Manjunath Goudar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V4 04/11] USB: OHCI: Properly handle ohci-da8xx suspend
Date: Thu, 20 Jun 2013 15:06:00 +0530	[thread overview]
Message-ID: <1371720968-7533-5-git-send-email-manjunath.goudar@linaro.org> (raw)
In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org>

Suspend scenario in case of ohci-da8xx glue was not
properly handled as it was not suspending generic part
of ohci controller. 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 at 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.

V4:
 -Properly aligned "do_wakeup" and "ret" variable.
---
 drivers/usb/host/ohci-da8xx.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

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

  parent reply	other threads:[~2013-06-20  9:36 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 15:28 [PATCH 00/10] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Manjunath Goudar
2013-06-12 15:28 ` [PATCH 01/10] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-06-12 16:04   ` Alan Stern
2013-06-12 16:25     ` Alan Stern
2013-06-12 15:28 ` [PATCH 02/10] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-06-12 15:58   ` Sergei Shtylyov
2013-06-12 15:28 ` [PATCH 03/10] USB: OHCI: Properly handle ohci-da8xx suspend Manjunath Goudar
2013-06-12 15:54   ` Sergei Shtylyov
2013-06-12 15:28 ` [PATCH 04/10] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-06-12 15:28 ` [PATCH 05/10] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-06-12 15:28 ` [PATCH 06/10] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-06-12 15:28 ` [PATCH 07/10] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-06-12 15:28 ` [PATCH 08/10] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-06-12 15:28 ` [PATCH 09/10] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-06-12 15:28 ` [PATCH 10/10] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-06-13  9:10 ` [PATCH 00/10] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Manjunath Goudar
2013-06-13  9:10   ` [PATCH 01/10] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 02/10] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 03/10] USB: OHCI: Properly handle ohci-da8xx suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 04/10] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 05/10] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 06/10] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 07/10] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-06-13  9:10   ` [PATCH 08/10] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-06-13  9:11   ` [PATCH 09/10] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-06-13  9:11   ` [PATCH 10/10] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-06-13  9:19     ` Viresh Kumar
2013-06-13 14:33       ` Alan Stern
2013-06-13  9:16 ` [PATCH V2 00/10] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Manjunath Goudar
2013-06-13  9:16   ` [PATCH V2 01/10] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-06-13 19:14     ` Alan Stern
     [not found]       ` <CAJFYCKG8i=33zXS-dhVJopaTVhCKJ_DCKo+q9wyx7CVzqzfn5g@mail.gmail.com>
2013-06-17  9:25         ` Viresh Kumar
2013-06-13  9:16   ` [PATCH V2 02/10] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-06-13 19:20     ` Alan Stern
2013-06-13  9:16   ` [PATCH V2 03/10] USB: OHCI: Properly handle ohci-da8xx suspend Manjunath Goudar
2013-06-13 19:26     ` Alan Stern
2013-06-13  9:16   ` [PATCH V2 04/10] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-06-13  9:16   ` [PATCH V2 05/10] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-06-13 19:29     ` Tomasz Figa
2013-06-13 19:52       ` Alan Stern
     [not found]         ` <CAJFYCKFHhD2LuPP5LKSXzg4zuCMmNTSWRRUQkwFcQVmXSaLo9Q@mail.gmail.com>
2013-06-18 10:02           ` Sachin Kamat
2013-06-18 15:06           ` Alan Stern
2013-06-13  9:16   ` [PATCH V2 06/10] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-06-13  9:16   ` [PATCH V2 07/10] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-06-13  9:16   ` [PATCH V2 08/10] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-06-13  9:16   ` [PATCH V2 09/10] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-06-13  9:16   ` [PATCH V2 10/10] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-06-19 12:12 ` [PATCH V3 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 01/11] USB: OHCI: Properly handle OHCI controller suspend Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 02/11] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-06-19 12:43     ` Sergei Shtylyov
     [not found]       ` <CAJFYCKGck29t211NTmXSKPtFdah3Pbe8T0UVZDsqWqqax3OL7g@mail.gmail.com>
2013-06-19 14:49         ` Viresh Kumar
2013-06-19 17:33         ` Sergei Shtylyov
2013-06-19 12:12   ` [PATCH V3 06/11] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-06-19 12:47     ` Sergei Shtylyov
2013-06-19 12:12   ` [PATCH V3 07/11] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 08/11] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-06-19 12:49     ` Sergei Shtylyov
2013-06-19 12:12   ` [PATCH V3 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-06-19 12:50     ` Sergei Shtylyov
2013-06-19 12:12   ` [PATCH V3 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-06-19 12:12   ` [PATCH V3 11/11] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-06-19 12:53     ` Sergei Shtylyov
2013-06-20  9:35 ` [PATCH V4 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Manjunath Goudar
2013-06-20  9:35   ` [PATCH V4 01/11] USB: OHCI: Properly handle OHCI controller suspend Manjunath Goudar
2013-06-20  9:35   ` [PATCH V4 02/11] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-06-20  9:35   ` [PATCH V4 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-06-20  9:36   ` Manjunath Goudar [this message]
2013-06-20 11:31     ` [PATCH V4 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Sergei Shtylyov
2013-06-20  9:36   ` [PATCH V4 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-06-20  9:36   ` [PATCH V4 06/11] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-06-20  9:36   ` [PATCH V4 07/11] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-06-20  9:36   ` [PATCH V4 08/11] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-06-20  9:36   ` [PATCH V4 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-06-20  9:36   ` [PATCH V4 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-06-20  9:36   ` [PATCH V4 11/11] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-06-20 19:50   ` [PATCH V4 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Alan Stern
2013-06-25  6:39 ` Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 01/11] USB: OHCI: Properly handle OHCI controller suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 02/11] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 06/11] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 07/11] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 08/11] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-06-25  6:39   ` [PATCH V4 11/11] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-07-22  9:32 ` [PATCH 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue Manjunath Goudar
2013-07-22  9:32   ` [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 02/11] USB: OHCI: Properly handle ohci-at91 suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 04/11] USB: OHCI: Properly handle ohci-da8xx suspend Manjunath Goudar
2013-07-22 12:18     ` Sergei Shtylyov
2013-07-22  9:32   ` [PATCH 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 06/11] USB: OHCI: Properly handle ohci-exynos suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 07/11] USB: OHCI: Properly handle ohci-omap suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 08/11] USB: OHCI: Properly handle ohci-platform suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 09/11] USB: OHCI: Properly handle ohci-pxa27x suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 10/11] USB: OHCI: Properly handle ohci-sm501 suspend Manjunath Goudar
2013-07-22  9:32   ` [PATCH 11/11] USB: OHCI: Properly handle ohci-spear suspend Manjunath Goudar
2013-07-22  9:51   ` [PATCH V4 00/11] USB: OHCI:Properly handle ohci_suspend()routine in bus glue manjunath
2013-07-23 23:06     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371720968-7533-5-git-send-email-manjunath.goudar@linaro.org \
    --to=manjunath.goudar@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.