Re: [PATCH 1/5] usb: xhci: add the suspend/resume functionality

2013-07-25 Thread Felipe Balbi
HI,

On Wed, Jul 24, 2013 at 10:54:47AM -0700, Sarah Sharp wrote:
 +#ifdef CONFIG_PM
 +static int xhci_plat_suspend(struct device *dev)
 +{
 + struct usb_hcd  *hcd = dev_get_drvdata(dev);
 + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 +
 + return xhci_suspend(xhci);
 +}

Where does the wakeup setting get taken into account?
   
   Which wakeup setting are you talking about?  Do you mean making sure the
   wake on bits are set for the roothub ports when the bus is suspended?
   Or do you mean that the platform device needs to have some way to enable
   wake from S3/S4 for the xHCI host controller itself?
  
  The latter.  Not only does there need to be some mechanism to wake up
  the system from S3/S4 when the xHCI controller detects a wakeup event;  
  there also has to be a way to enable or disable this mechanism 
  depending on the value of device_may_wakeup(dev).
 
 Ok, that sounds like something that needs to be addressed on top of this
 patch.  Vikas, Abhilash, or Felipe, can you create a patch that fixes
 this?

I won't have time for this at least for a couple months, if someone who
already has access to a chromebook with a working setup can handle that,
I'd be glad.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 1/5] usb: xhci: add the suspend/resume functionality

2013-07-24 Thread Alan Stern
On Tue, 23 Jul 2013, Sarah Sharp wrote:

 From: Vikas Sajjan vikas.saj...@linaro.org
 
 Adds power management support to xHCI platform driver.
 
 This patch facilitates the transition of xHCI host controller
 between S0 and S3/S4 power states, during suspend/resume cycles.
 
 Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
 Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
 CC: Doug Anderson diand...@chromium.org
 Signed-off-by: Felipe Balbi ba...@ti.com
 Signed-off-by: Sarah Sharp sarah.a.sh...@linux.intel.com
 ---
  drivers/usb/host/xhci-plat.c |   26 ++
  1 files changed, 26 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
 index 51e22bf..412fe8d 100644
 --- a/drivers/usb/host/xhci-plat.c
 +++ b/drivers/usb/host/xhci-plat.c
 @@ -186,11 +186,37 @@ static int xhci_plat_remove(struct platform_device *dev)
   return 0;
  }
  
 +#ifdef CONFIG_PM
 +static int xhci_plat_suspend(struct device *dev)
 +{
 + struct usb_hcd  *hcd = dev_get_drvdata(dev);
 + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 +
 + return xhci_suspend(xhci);
 +}

Where does the wakeup setting get taken into account?

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] usb: xhci: add the suspend/resume functionality

2013-07-24 Thread Sarah Sharp
On Wed, Jul 24, 2013 at 11:55:57AM -0400, Alan Stern wrote:
 On Tue, 23 Jul 2013, Sarah Sharp wrote:
 
  From: Vikas Sajjan vikas.saj...@linaro.org
  
  Adds power management support to xHCI platform driver.
  
  This patch facilitates the transition of xHCI host controller
  between S0 and S3/S4 power states, during suspend/resume cycles.
  
  Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
  Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
  CC: Doug Anderson diand...@chromium.org
  Signed-off-by: Felipe Balbi ba...@ti.com
  Signed-off-by: Sarah Sharp sarah.a.sh...@linux.intel.com
  ---
   drivers/usb/host/xhci-plat.c |   26 ++
   1 files changed, 26 insertions(+), 0 deletions(-)
  
  diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
  index 51e22bf..412fe8d 100644
  --- a/drivers/usb/host/xhci-plat.c
  +++ b/drivers/usb/host/xhci-plat.c
  @@ -186,11 +186,37 @@ static int xhci_plat_remove(struct platform_device 
  *dev)
  return 0;
   }
   
  +#ifdef CONFIG_PM
  +static int xhci_plat_suspend(struct device *dev)
  +{
  +   struct usb_hcd  *hcd = dev_get_drvdata(dev);
  +   struct xhci_hcd *xhci = hcd_to_xhci(hcd);
  +
  +   return xhci_suspend(xhci);
  +}
 
 Where does the wakeup setting get taken into account?

Which wakeup setting are you talking about?  Do you mean making sure the
wake on bits are set for the roothub ports when the bus is suspended?
Or do you mean that the platform device needs to have some way to enable
wake from S3/S4 for the xHCI host controller itself?

Sarah Sharp
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] usb: xhci: add the suspend/resume functionality

2013-07-24 Thread Sarah Sharp
On Wed, Jul 24, 2013 at 01:02:31PM -0400, Alan Stern wrote:
 On Wed, 24 Jul 2013, Sarah Sharp wrote:
 
+#ifdef CONFIG_PM
+static int xhci_plat_suspend(struct device *dev)
+{
+   struct usb_hcd  *hcd = dev_get_drvdata(dev);
+   struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+
+   return xhci_suspend(xhci);
+}
   
   Where does the wakeup setting get taken into account?
  
  Which wakeup setting are you talking about?  Do you mean making sure the
  wake on bits are set for the roothub ports when the bus is suspended?
  Or do you mean that the platform device needs to have some way to enable
  wake from S3/S4 for the xHCI host controller itself?
 
 The latter.  Not only does there need to be some mechanism to wake up
 the system from S3/S4 when the xHCI controller detects a wakeup event;  
 there also has to be a way to enable or disable this mechanism 
 depending on the value of device_may_wakeup(dev).

Ok, that sounds like something that needs to be addressed on top of this
patch.  Vikas, Abhilash, or Felipe, can you create a patch that fixes
this?

Thanks,
Sarah Sharp
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/5] usb: xhci: add the suspend/resume functionality

2013-07-23 Thread Sarah Sharp
From: Vikas Sajjan vikas.saj...@linaro.org

Adds power management support to xHCI platform driver.

This patch facilitates the transition of xHCI host controller
between S0 and S3/S4 power states, during suspend/resume cycles.

Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
Signed-off-by: Vikas C Sajjan vikas.saj...@linaro.org
CC: Doug Anderson diand...@chromium.org
Signed-off-by: Felipe Balbi ba...@ti.com
Signed-off-by: Sarah Sharp sarah.a.sh...@linux.intel.com
---
 drivers/usb/host/xhci-plat.c |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 51e22bf..412fe8d 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -186,11 +186,37 @@ static int xhci_plat_remove(struct platform_device *dev)
return 0;
 }
 
+#ifdef CONFIG_PM
+static int xhci_plat_suspend(struct device *dev)
+{
+   struct usb_hcd  *hcd = dev_get_drvdata(dev);
+   struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+
+   return xhci_suspend(xhci);
+}
+
+static int xhci_plat_resume(struct device *dev)
+{
+   struct usb_hcd  *hcd = dev_get_drvdata(dev);
+   struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+
+   return xhci_resume(xhci, 0);
+}
+
+static const struct dev_pm_ops xhci_plat_pm_ops = {
+   SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
+};
+#define DEV_PM_OPS (xhci_plat_pm_ops)
+#else
+#define DEV_PM_OPS NULL
+#endif /* CONFIG_PM */
+
 static struct platform_driver usb_xhci_driver = {
.probe  = xhci_plat_probe,
.remove = xhci_plat_remove,
.driver = {
.name = xhci-hcd,
+   .pm = DEV_PM_OPS,
},
 };
 MODULE_ALIAS(platform:xhci-hcd);
-- 
1.7.9

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html