* [PATCH 0/7] usb: dwc3: pm_runtime implementation
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, Linux ARM Kernel Mailing List,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
Linux OMAP Mailing List, w-kwok2-l0cyMroinI0, Santosh Shilimkar,
Felipe Balbi
hi all,
these patches add pm_runtime support for all glue layers.
I plan to add pm_runtime support for dwc3 after these
patches are merged upstream.
Please test.
Felipe Balbi (7):
usb: dwc3: keystone: add basic PM support
usb: dwc3: omap: add basic pm_runtime support
usb: dwc3: pci: add pm_runtime support
usb: dwc3: omap: fix pm_runtime usage
usb: dwc3: omap: fix order of pm_runtime vs child removal
usb: dwc3: exynos: remove DEV_PM_OPS hackery
usb: dwc3: exynos: add pm_runtime support
drivers/usb/dwc3/dwc3-exynos.c | 73 +++++++++++++++++++++++-------
drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
drivers/usb/dwc3/dwc3-omap.c | 45 +++++++++++++++----
drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++-------
4 files changed, 239 insertions(+), 42 deletions(-)
--
1.8.4.GIT
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 0/7] usb: dwc3: pm_runtime implementation
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
hi all,
these patches add pm_runtime support for all glue layers.
I plan to add pm_runtime support for dwc3 after these
patches are merged upstream.
Please test.
Felipe Balbi (7):
usb: dwc3: keystone: add basic PM support
usb: dwc3: omap: add basic pm_runtime support
usb: dwc3: pci: add pm_runtime support
usb: dwc3: omap: fix pm_runtime usage
usb: dwc3: omap: fix order of pm_runtime vs child removal
usb: dwc3: exynos: remove DEV_PM_OPS hackery
usb: dwc3: exynos: add pm_runtime support
drivers/usb/dwc3/dwc3-exynos.c | 73 +++++++++++++++++++++++-------
drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
drivers/usb/dwc3/dwc3-omap.c | 45 +++++++++++++++----
drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++-------
4 files changed, 239 insertions(+), 42 deletions(-)
--
1.8.4.GIT
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 1/7] usb: dwc3: keystone: add basic PM support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar,
Felipe Balbi
A bare-minimum PM implementation which will
server as building block for more complex
PM implementation in the future.
At the least will not leave clocks on unnecessarily
when e.g. a user write mem to /sys/power/state.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 94 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 1fad161..361437f 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
+#include <linux/pm_runtime.h>
#include <linux/io.h>
#include <linux/of_platform.h>
@@ -118,13 +119,23 @@ static int kdwc3_probe(struct platform_device *pdev)
kdwc->clk = devm_clk_get(kdwc->dev, "usb");
- error = clk_prepare_enable(kdwc->clk);
+ error = clk_prepare(kdwc->clk);
if (error < 0) {
dev_dbg(kdwc->dev, "unable to enable usb clock, err %d\n",
error);
return error;
}
+ pm_runtime_enable(dev);
+
+ error = pm_runtime_get_sync(dev);
+ if (error < 0) {
+ dev_dbg(dev, "unable to pm_runtime_get_sync(), err %d\n",
+ error);
+ pm_runtime_put_sync(dev);
+ goto err_runtime_get;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "missing irq\n");
@@ -151,8 +162,13 @@ static int kdwc3_probe(struct platform_device *pdev)
err_core:
kdwc3_disable_irqs(kdwc);
+
err_irq:
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(dev);
+
+err_runtime_get:
+ pm_runtime_disable(dev);
+ clk_unprepare(kdwc->clk);
return error;
}
@@ -172,7 +188,9 @@ static int kdwc3_remove(struct platform_device *pdev)
kdwc3_disable_irqs(kdwc);
device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ clk_unprepare(kdwc->clk);
platform_set_drvdata(pdev, NULL);
return 0;
@@ -184,6 +202,79 @@ static const struct of_device_id kdwc3_of_match[] = {
};
MODULE_DEVICE_TABLE(of, kdwc3_of_match);
+static int __kdwc3_suspend(struct dwc3_keystone *kdwc)
+{
+ clk_disable(kdwc->clk);
+
+ return 0;
+}
+
+static int __kdwc3_resume(struct dwc3_keystone *kdwc)
+{
+ return clk_enable(kdwc->clk);
+}
+
+static int kdwc3_prepare(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_disable_irqs(kdwc);
+
+ return 0;
+}
+
+static void kdwc3_complete(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_enable_irqs(kdwc);
+}
+
+static int kdwc3_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = __kdwc3_resume(kdwc);
+ if (ret)
+ return ret;
+
+ pm_runtime_disable(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
+ return 0;
+}
+
+static int kdwc3_runtime_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_runtime_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_resume(kdwc);
+}
+
+static const struct dev_pm_ops kdwc3_dev_pm_ops = {
+ .prepare = kdwc3_prepare,
+ .complete = kdwc3_complete,
+
+ SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
+ SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
+};
+
static struct platform_driver kdwc3_driver = {
.probe = kdwc3_probe,
.remove = kdwc3_remove,
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
A bare-minimum PM implementation which will
server as building block for more complex
PM implementation in the future.
At the least will not leave clocks on unnecessarily
when e.g. a user write mem to /sys/power/state.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 94 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 1fad161..361437f 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
+#include <linux/pm_runtime.h>
#include <linux/io.h>
#include <linux/of_platform.h>
@@ -118,13 +119,23 @@ static int kdwc3_probe(struct platform_device *pdev)
kdwc->clk = devm_clk_get(kdwc->dev, "usb");
- error = clk_prepare_enable(kdwc->clk);
+ error = clk_prepare(kdwc->clk);
if (error < 0) {
dev_dbg(kdwc->dev, "unable to enable usb clock, err %d\n",
error);
return error;
}
+ pm_runtime_enable(dev);
+
+ error = pm_runtime_get_sync(dev);
+ if (error < 0) {
+ dev_dbg(dev, "unable to pm_runtime_get_sync(), err %d\n",
+ error);
+ pm_runtime_put_sync(dev);
+ goto err_runtime_get;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "missing irq\n");
@@ -151,8 +162,13 @@ static int kdwc3_probe(struct platform_device *pdev)
err_core:
kdwc3_disable_irqs(kdwc);
+
err_irq:
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(dev);
+
+err_runtime_get:
+ pm_runtime_disable(dev);
+ clk_unprepare(kdwc->clk);
return error;
}
@@ -172,7 +188,9 @@ static int kdwc3_remove(struct platform_device *pdev)
kdwc3_disable_irqs(kdwc);
device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ clk_unprepare(kdwc->clk);
platform_set_drvdata(pdev, NULL);
return 0;
@@ -184,6 +202,79 @@ static const struct of_device_id kdwc3_of_match[] = {
};
MODULE_DEVICE_TABLE(of, kdwc3_of_match);
+static int __kdwc3_suspend(struct dwc3_keystone *kdwc)
+{
+ clk_disable(kdwc->clk);
+
+ return 0;
+}
+
+static int __kdwc3_resume(struct dwc3_keystone *kdwc)
+{
+ return clk_enable(kdwc->clk);
+}
+
+static int kdwc3_prepare(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_disable_irqs(kdwc);
+
+ return 0;
+}
+
+static void kdwc3_complete(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_enable_irqs(kdwc);
+}
+
+static int kdwc3_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = __kdwc3_resume(kdwc);
+ if (ret)
+ return ret;
+
+ pm_runtime_disable(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
+ return 0;
+}
+
+static int kdwc3_runtime_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_runtime_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_resume(kdwc);
+}
+
+static const struct dev_pm_ops kdwc3_dev_pm_ops = {
+ .prepare = kdwc3_prepare,
+ .complete = kdwc3_complete,
+
+ SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
+ SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
+};
+
static struct platform_driver kdwc3_driver = {
.probe = kdwc3_probe,
.remove = kdwc3_remove,
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 2/7] usb: dwc3: omap: add basic pm_runtime support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar,
Felipe Balbi
If we want to suspend/runtime in runtime, we
can do so, in OMAP's case at least, with the
same implementation we use for system pm.
This patch adds basic pm_runtime support with
that in mind.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index b269dbd..aea305d 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -617,20 +617,35 @@ static void dwc3_omap_complete(struct device *dev)
dwc3_omap_enable_irqs(omap);
}
-static int dwc3_omap_suspend(struct device *dev)
+static int __dwc3_omap_suspend(struct dwc3_omap *omap)
{
- struct dwc3_omap *omap = dev_get_drvdata(dev);
-
omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap);
return 0;
}
+static int __dwc3_omap_resume(struct dwc3_omap *omap)
+{
+ dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status);
+
+ return 0;
+}
+
+static int dwc3_omap_suspend(struct device *dev)
+{
+ struct dwc3_omap *omap = dev_get_drvdata(dev);
+
+ return __dwc3_omap_suspend(omap);
+}
+
static int dwc3_omap_resume(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);
+ int ret;
- dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status);
+ ret = __dwc3_omap_resume(omap);
+ if (ret)
+ return ret;
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
@@ -639,11 +654,27 @@ static int dwc3_omap_resume(struct device *dev)
return 0;
}
+static int dwc3_omap_runtime_suspend(struct device *dev)
+{
+ struct dwc3_omap *omap = dev_get_drvdata(dev);
+
+ return __dwc3_omap_suspend(omap);
+}
+
+static int dwc3_omap_runtime_resume(struct device *dev)
+{
+ struct dwc3_omap *omap = dev_get_drvdata(dev);
+
+ return __dwc3_omap_resume(omap);
+}
+
static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
.prepare = dwc3_omap_prepare,
.complete = dwc3_omap_complete,
SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
+ SET_RUNTIME_PM_OPS(dwc3_omap_runtime_suspend, dwc3_omap_runtime_resume,
+ NULL)
};
#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops)
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 2/7] usb: dwc3: omap: add basic pm_runtime support
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
If we want to suspend/runtime in runtime, we
can do so, in OMAP's case at least, with the
same implementation we use for system pm.
This patch adds basic pm_runtime support with
that in mind.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index b269dbd..aea305d 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -617,20 +617,35 @@ static void dwc3_omap_complete(struct device *dev)
dwc3_omap_enable_irqs(omap);
}
-static int dwc3_omap_suspend(struct device *dev)
+static int __dwc3_omap_suspend(struct dwc3_omap *omap)
{
- struct dwc3_omap *omap = dev_get_drvdata(dev);
-
omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap);
return 0;
}
+static int __dwc3_omap_resume(struct dwc3_omap *omap)
+{
+ dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status);
+
+ return 0;
+}
+
+static int dwc3_omap_suspend(struct device *dev)
+{
+ struct dwc3_omap *omap = dev_get_drvdata(dev);
+
+ return __dwc3_omap_suspend(omap);
+}
+
static int dwc3_omap_resume(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);
+ int ret;
- dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status);
+ ret = __dwc3_omap_resume(omap);
+ if (ret)
+ return ret;
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
@@ -639,11 +654,27 @@ static int dwc3_omap_resume(struct device *dev)
return 0;
}
+static int dwc3_omap_runtime_suspend(struct device *dev)
+{
+ struct dwc3_omap *omap = dev_get_drvdata(dev);
+
+ return __dwc3_omap_suspend(omap);
+}
+
+static int dwc3_omap_runtime_resume(struct device *dev)
+{
+ struct dwc3_omap *omap = dev_get_drvdata(dev);
+
+ return __dwc3_omap_resume(omap);
+}
+
static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
.prepare = dwc3_omap_prepare,
.complete = dwc3_omap_complete,
SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
+ SET_RUNTIME_PM_OPS(dwc3_omap_runtime_suspend, dwc3_omap_runtime_resume,
+ NULL)
};
#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops)
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, Linux ARM Kernel Mailing List,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
Linux OMAP Mailing List, w-kwok2-l0cyMroinI0, Santosh Shilimkar,
Felipe Balbi
teach the PCI glue about pm_runtime so that
it's easier to teach dwc3 core about it
later.
No functional changes otherwise.
Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 51 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 665686e..78cd0b0 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -109,18 +109,17 @@ static int dwc3_pci_probe(struct pci_dev *pci,
glue->dev = dev;
- ret = pci_enable_device(pci);
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
if (ret) {
dev_err(dev, "failed to enable pci device\n");
return -ENODEV;
}
- pci_set_master(pci);
-
ret = dwc3_pci_register_phys(glue);
if (ret) {
dev_err(dev, "couldn't register PHYs\n");
- return ret;
+ goto err1;
}
dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO);
@@ -167,7 +166,8 @@ static int dwc3_pci_probe(struct pci_dev *pci,
err3:
platform_device_put(dwc3);
err1:
- pci_disable_device(pci);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
return ret;
}
@@ -175,11 +175,13 @@ err1:
static void dwc3_pci_remove(struct pci_dev *pci)
{
struct dwc3_pci *glue = pci_get_drvdata(pci);
+ struct device *dev = &pci->dev;
platform_device_unregister(glue->dwc3);
platform_device_unregister(glue->usb2_phy);
platform_device_unregister(glue->usb3_phy);
- pci_disable_device(pci);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
}
static const struct pci_device_id dwc3_pci_id_table[] = {
@@ -193,24 +195,20 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
};
MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
-#ifdef CONFIG_PM_SLEEP
-static int dwc3_pci_suspend(struct device *dev)
+static int __dwc3_pci_suspend(struct pci_dev *pci)
{
- struct pci_dev *pci = to_pci_dev(dev);
-
pci_disable_device(pci);
return 0;
}
-static int dwc3_pci_resume(struct device *dev)
+static int __dwc3_pci_resume(struct pci_dev *pci)
{
- struct pci_dev *pci = to_pci_dev(dev);
- int ret;
+ int ret;
ret = pci_enable_device(pci);
if (ret) {
- dev_err(dev, "can't re-enable device --> %d\n", ret);
+ dev_err(&pci->dev, "can't re-enable device --> %d\n", ret);
return ret;
}
@@ -218,10 +216,48 @@ static int dwc3_pci_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
+
+static int dwc3_pci_suspend(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+
+ return __dwc3_pci_suspend(pci);
+}
+
+static int dwc3_pci_resume(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+ int ret;
+
+ ret = __dwc3_pci_resume(pci);
+ if (ret)
+ return ret;
+
+ pm_runtime_disable(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_disable(dev);
+
+ return 0;
+}
+
+static int dwc3_pci_runtime_suspend(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+
+ return __dwc3_pci_suspend(pci);
+}
+
+static int dwc3_pci_runtime_resume(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+
+ return __dwc3_pci_resume(pci);
+}
static const struct dev_pm_ops dwc3_pci_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_suspend, dwc3_pci_resume)
+ SET_RUNTIME_PM_OPS(dwc3_pci_runtime_suspend, dwc3_pci_runtime_resume,
+ NULL)
};
static struct pci_driver dwc3_pci_driver = {
--
1.8.4.GIT
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
teach the PCI glue about pm_runtime so that
it's easier to teach dwc3 core about it
later.
No functional changes otherwise.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 51 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 665686e..78cd0b0 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -109,18 +109,17 @@ static int dwc3_pci_probe(struct pci_dev *pci,
glue->dev = dev;
- ret = pci_enable_device(pci);
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
if (ret) {
dev_err(dev, "failed to enable pci device\n");
return -ENODEV;
}
- pci_set_master(pci);
-
ret = dwc3_pci_register_phys(glue);
if (ret) {
dev_err(dev, "couldn't register PHYs\n");
- return ret;
+ goto err1;
}
dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO);
@@ -167,7 +166,8 @@ static int dwc3_pci_probe(struct pci_dev *pci,
err3:
platform_device_put(dwc3);
err1:
- pci_disable_device(pci);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
return ret;
}
@@ -175,11 +175,13 @@ err1:
static void dwc3_pci_remove(struct pci_dev *pci)
{
struct dwc3_pci *glue = pci_get_drvdata(pci);
+ struct device *dev = &pci->dev;
platform_device_unregister(glue->dwc3);
platform_device_unregister(glue->usb2_phy);
platform_device_unregister(glue->usb3_phy);
- pci_disable_device(pci);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
}
static const struct pci_device_id dwc3_pci_id_table[] = {
@@ -193,24 +195,20 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
};
MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
-#ifdef CONFIG_PM_SLEEP
-static int dwc3_pci_suspend(struct device *dev)
+static int __dwc3_pci_suspend(struct pci_dev *pci)
{
- struct pci_dev *pci = to_pci_dev(dev);
-
pci_disable_device(pci);
return 0;
}
-static int dwc3_pci_resume(struct device *dev)
+static int __dwc3_pci_resume(struct pci_dev *pci)
{
- struct pci_dev *pci = to_pci_dev(dev);
- int ret;
+ int ret;
ret = pci_enable_device(pci);
if (ret) {
- dev_err(dev, "can't re-enable device --> %d\n", ret);
+ dev_err(&pci->dev, "can't re-enable device --> %d\n", ret);
return ret;
}
@@ -218,10 +216,48 @@ static int dwc3_pci_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
+
+static int dwc3_pci_suspend(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+
+ return __dwc3_pci_suspend(pci);
+}
+
+static int dwc3_pci_resume(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+ int ret;
+
+ ret = __dwc3_pci_resume(pci);
+ if (ret)
+ return ret;
+
+ pm_runtime_disable(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_disable(dev);
+
+ return 0;
+}
+
+static int dwc3_pci_runtime_suspend(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+
+ return __dwc3_pci_suspend(pci);
+}
+
+static int dwc3_pci_runtime_resume(struct device *dev)
+{
+ struct pci_dev *pci = to_pci_dev(dev);
+
+ return __dwc3_pci_resume(pci);
+}
static const struct dev_pm_ops dwc3_pci_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_suspend, dwc3_pci_resume)
+ SET_RUNTIME_PM_OPS(dwc3_pci_runtime_suspend, dwc3_pci_runtime_resume,
+ NULL)
};
static struct pci_driver dwc3_pci_driver = {
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 4/7] usb: dwc3: omap: fix pm_runtime usage
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar,
Felipe Balbi
even if pm_runtime_get*() fails, it still increments
pm usage counter, so we must pm_runtime_put*()
in that case too. Fix that observation in dwc3-omap.c.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index aea305d..076bb28 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -451,7 +451,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "get_sync failed with err %d\n", ret);
- goto err0;
+ goto err1;
}
reg = dwc3_omap_readl(omap->base, USBOTGSS_REVISION);
@@ -566,8 +566,6 @@ err2:
err1:
pm_runtime_put_sync(dev);
-
-err0:
pm_runtime_disable(dev);
return ret;
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 4/7] usb: dwc3: omap: fix pm_runtime usage
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
even if pm_runtime_get*() fails, it still increments
pm usage counter, so we must pm_runtime_put*()
in that case too. Fix that observation in dwc3-omap.c.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index aea305d..076bb28 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -451,7 +451,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "get_sync failed with err %d\n", ret);
- goto err0;
+ goto err1;
}
reg = dwc3_omap_readl(omap->base, USBOTGSS_REVISION);
@@ -566,8 +566,6 @@ err2:
err1:
pm_runtime_put_sync(dev);
-
-err0:
pm_runtime_disable(dev);
return ret;
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 5/7] usb: dwc3: omap: fix order of pm_runtime vs child removal
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, Linux ARM Kernel Mailing List,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
Linux OMAP Mailing List, w-kwok2-l0cyMroinI0, Santosh Shilimkar,
Felipe Balbi
pm_runtime_put_sync() will kill dwc3's clocks and,
since dwc3 core accesses registers during removal,
we must make sure to unregister core before
disabling clocks and pm_runtime.
Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
drivers/usb/dwc3/dwc3-omap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 076bb28..a9090a1 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -580,9 +580,9 @@ static int dwc3_omap_remove(struct platform_device *pdev)
if (omap->extcon_id_dev.edev)
extcon_unregister_interest(&omap->extcon_id_dev);
dwc3_omap_disable_irqs(omap);
+ device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
- device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
return 0;
}
--
1.8.4.GIT
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 5/7] usb: dwc3: omap: fix order of pm_runtime vs child removal
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
pm_runtime_put_sync() will kill dwc3's clocks and,
since dwc3 core accesses registers during removal,
we must make sure to unregister core before
disabling clocks and pm_runtime.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 076bb28..a9090a1 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -580,9 +580,9 @@ static int dwc3_omap_remove(struct platform_device *pdev)
if (omap->extcon_id_dev.edev)
extcon_unregister_interest(&omap->extcon_id_dev);
dwc3_omap_disable_irqs(omap);
+ device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
- device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
return 0;
}
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 6/7] usb: dwc3: exynos: remove DEV_PM_OPS hackery
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar,
Felipe Balbi
it's best to just remove all ifdefs and always
define our dev_pm_ops structure.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-exynos.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 8b20c70..6ccfc64 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -184,7 +184,6 @@ static const struct of_device_id exynos_dwc3_match[] = {
MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
#endif
-#ifdef CONFIG_PM_SLEEP
static int dwc3_exynos_suspend(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
@@ -212,18 +211,13 @@ static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume)
};
-#define DEV_PM_OPS (&dwc3_exynos_dev_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
-
static struct platform_driver dwc3_exynos_driver = {
.probe = dwc3_exynos_probe,
.remove = dwc3_exynos_remove,
.driver = {
.name = "exynos-dwc3",
.of_match_table = of_match_ptr(exynos_dwc3_match),
- .pm = DEV_PM_OPS,
+ .pm = &dwc3_exynos_dev_pm_ops,
},
};
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 6/7] usb: dwc3: exynos: remove DEV_PM_OPS hackery
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
it's best to just remove all ifdefs and always
define our dev_pm_ops structure.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-exynos.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 8b20c70..6ccfc64 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -184,7 +184,6 @@ static const struct of_device_id exynos_dwc3_match[] = {
MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
#endif
-#ifdef CONFIG_PM_SLEEP
static int dwc3_exynos_suspend(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
@@ -212,18 +211,13 @@ static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume)
};
-#define DEV_PM_OPS (&dwc3_exynos_dev_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
-
static struct platform_driver dwc3_exynos_driver = {
.probe = dwc3_exynos_probe,
.remove = dwc3_exynos_remove,
.driver = {
.name = "exynos-dwc3",
.of_match_table = of_match_ptr(exynos_dwc3_match),
- .pm = DEV_PM_OPS,
+ .pm = &dwc3_exynos_dev_pm_ops,
},
};
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:38 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar,
Felipe Balbi
teach Exynos glue about pm_runtime so that
it's easier to teach dwc3 core about it
later.
No functional changes otherwise.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-exynos.c | 65 ++++++++++++++++++++++++++++++++++++------
1 file changed, 56 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 6ccfc64..c93919a 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -141,24 +141,40 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
exynos->dev = dev;
exynos->clk = clk;
- clk_prepare_enable(exynos->clk);
+ ret = clk_prepare(exynos->clk);
+ if (ret) {
+ dev_err(dev, "failed to prepare clock\n");
+ goto err2;
+ }
+
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
+ if (ret) {
+ dev_err(dev, "failed to enable dwc3 device\n");
+ goto err3;
+ }
if (node) {
ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) {
dev_err(dev, "failed to add dwc3 core\n");
- goto err2;
+ goto err3;
}
} else {
dev_err(dev, "no device node, failed to add dwc3 core\n");
ret = -ENODEV;
- goto err2;
+ goto err3;
}
return 0;
+err3:
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+
err2:
- clk_disable_unprepare(clk);
+ clk_unprepare(clk);
+
err1:
return ret;
}
@@ -171,7 +187,9 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
platform_device_unregister(exynos->usb2_phy);
platform_device_unregister(exynos->usb3_phy);
- clk_disable_unprepare(exynos->clk);
+ pm_runtime_put_sync(exynos->dev);
+ pm_runtime_disable(exynos->dev);
+ clk_unprepare(exynos->clk);
return 0;
}
@@ -184,20 +202,33 @@ static const struct of_device_id exynos_dwc3_match[] = {
MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
#endif
-static int dwc3_exynos_suspend(struct device *dev)
+static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
{
- struct dwc3_exynos *exynos = dev_get_drvdata(dev);
-
clk_disable(exynos->clk);
return 0;
}
+static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
+{
+ return clk_enable(exynos->clk);
+}
+
+static int dwc3_exynos_suspend(struct device *dev)
+{
+ struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+
+ return __dwc3_exynos_suspend(exynos);
+}
+
static int dwc3_exynos_resume(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+ int ret;
- clk_enable(exynos->clk);
+ ret = __dwc3_exynos_resume(exynos);
+ if (ret)
+ return ret;
/* runtime set active to reflect active state. */
pm_runtime_disable(dev);
@@ -207,8 +238,24 @@ static int dwc3_exynos_resume(struct device *dev)
return 0;
}
+static int dwc3_exynos_runtime_suspend(struct device *dev)
+{
+ struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+
+ return __dwc3_exynos_suspend(exynos);
+}
+
+static int dwc3_exynos_runtime_resume(struct device *dev)
+{
+ struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+
+ return __dwc3_exynos_resume(exynos);
+}
+
static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume)
+ SET_RUNTIME_PM_OPS(dwc3_exynos_runtime_suspend,
+ dwc3_exynos_runtime_resume, NULL)
};
static struct platform_driver dwc3_exynos_driver = {
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
@ 2013-12-12 21:38 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:38 UTC (permalink / raw)
To: linux-arm-kernel
teach Exynos glue about pm_runtime so that
it's easier to teach dwc3 core about it
later.
No functional changes otherwise.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/dwc3/dwc3-exynos.c | 65 ++++++++++++++++++++++++++++++++++++------
1 file changed, 56 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 6ccfc64..c93919a 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -141,24 +141,40 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
exynos->dev = dev;
exynos->clk = clk;
- clk_prepare_enable(exynos->clk);
+ ret = clk_prepare(exynos->clk);
+ if (ret) {
+ dev_err(dev, "failed to prepare clock\n");
+ goto err2;
+ }
+
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
+ if (ret) {
+ dev_err(dev, "failed to enable dwc3 device\n");
+ goto err3;
+ }
if (node) {
ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) {
dev_err(dev, "failed to add dwc3 core\n");
- goto err2;
+ goto err3;
}
} else {
dev_err(dev, "no device node, failed to add dwc3 core\n");
ret = -ENODEV;
- goto err2;
+ goto err3;
}
return 0;
+err3:
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+
err2:
- clk_disable_unprepare(clk);
+ clk_unprepare(clk);
+
err1:
return ret;
}
@@ -171,7 +187,9 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
platform_device_unregister(exynos->usb2_phy);
platform_device_unregister(exynos->usb3_phy);
- clk_disable_unprepare(exynos->clk);
+ pm_runtime_put_sync(exynos->dev);
+ pm_runtime_disable(exynos->dev);
+ clk_unprepare(exynos->clk);
return 0;
}
@@ -184,20 +202,33 @@ static const struct of_device_id exynos_dwc3_match[] = {
MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
#endif
-static int dwc3_exynos_suspend(struct device *dev)
+static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
{
- struct dwc3_exynos *exynos = dev_get_drvdata(dev);
-
clk_disable(exynos->clk);
return 0;
}
+static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
+{
+ return clk_enable(exynos->clk);
+}
+
+static int dwc3_exynos_suspend(struct device *dev)
+{
+ struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+
+ return __dwc3_exynos_suspend(exynos);
+}
+
static int dwc3_exynos_resume(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+ int ret;
- clk_enable(exynos->clk);
+ ret = __dwc3_exynos_resume(exynos);
+ if (ret)
+ return ret;
/* runtime set active to reflect active state. */
pm_runtime_disable(dev);
@@ -207,8 +238,24 @@ static int dwc3_exynos_resume(struct device *dev)
return 0;
}
+static int dwc3_exynos_runtime_suspend(struct device *dev)
+{
+ struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+
+ return __dwc3_exynos_suspend(exynos);
+}
+
+static int dwc3_exynos_runtime_resume(struct device *dev)
+{
+ struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+
+ return __dwc3_exynos_resume(exynos);
+}
+
static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume)
+ SET_RUNTIME_PM_OPS(dwc3_exynos_runtime_suspend,
+ dwc3_exynos_runtime_resume, NULL)
};
static struct platform_driver dwc3_exynos_driver = {
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* Re: [PATCH 1/7] usb: dwc3: keystone: add basic PM support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-12 21:43 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:43 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim, Linux ARM Kernel Mailing List,
linux-samsung-soc, Linux OMAP Mailing List, w-kwok2,
Santosh Shilimkar
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
On Thu, Dec 12, 2013 at 03:38:39PM -0600, Felipe Balbi wrote:
> A bare-minimum PM implementation which will
> server as building block for more complex
> PM implementation in the future.
>
> At the least will not leave clocks on unnecessarily
> when e.g. a user write mem to /sys/power/state.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
> drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 94 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
> index 1fad161..361437f 100644
> --- a/drivers/usb/dwc3/dwc3-keystone.c
> +++ b/drivers/usb/dwc3/dwc3-keystone.c
> @@ -21,6 +21,7 @@
> #include <linux/interrupt.h>
> #include <linux/platform_device.h>
> #include <linux/dma-mapping.h>
> +#include <linux/pm_runtime.h>
> #include <linux/io.h>
> #include <linux/of_platform.h>
>
> @@ -118,13 +119,23 @@ static int kdwc3_probe(struct platform_device *pdev)
>
> kdwc->clk = devm_clk_get(kdwc->dev, "usb");
>
> - error = clk_prepare_enable(kdwc->clk);
> + error = clk_prepare(kdwc->clk);
> if (error < 0) {
> dev_dbg(kdwc->dev, "unable to enable usb clock, err %d\n",
> error);
> return error;
> }
>
> + pm_runtime_enable(dev);
> +
> + error = pm_runtime_get_sync(dev);
> + if (error < 0) {
> + dev_dbg(dev, "unable to pm_runtime_get_sync(), err %d\n",
> + error);
> + pm_runtime_put_sync(dev);
I can move this pm_runtime_sync() to error path, will refresh this
patch.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-12 21:43 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:43 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 12, 2013 at 03:38:39PM -0600, Felipe Balbi wrote:
> A bare-minimum PM implementation which will
> server as building block for more complex
> PM implementation in the future.
>
> At the least will not leave clocks on unnecessarily
> when e.g. a user write mem to /sys/power/state.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
> drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 94 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
> index 1fad161..361437f 100644
> --- a/drivers/usb/dwc3/dwc3-keystone.c
> +++ b/drivers/usb/dwc3/dwc3-keystone.c
> @@ -21,6 +21,7 @@
> #include <linux/interrupt.h>
> #include <linux/platform_device.h>
> #include <linux/dma-mapping.h>
> +#include <linux/pm_runtime.h>
> #include <linux/io.h>
> #include <linux/of_platform.h>
>
> @@ -118,13 +119,23 @@ static int kdwc3_probe(struct platform_device *pdev)
>
> kdwc->clk = devm_clk_get(kdwc->dev, "usb");
>
> - error = clk_prepare_enable(kdwc->clk);
> + error = clk_prepare(kdwc->clk);
> if (error < 0) {
> dev_dbg(kdwc->dev, "unable to enable usb clock, err %d\n",
> error);
> return error;
> }
>
> + pm_runtime_enable(dev);
> +
> + error = pm_runtime_get_sync(dev);
> + if (error < 0) {
> + dev_dbg(dev, "unable to pm_runtime_get_sync(), err %d\n",
> + error);
> + pm_runtime_put_sync(dev);
I can move this pm_runtime_sync() to error path, will refresh this
patch.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131212/48ff909e/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-12 21:43 ` Felipe Balbi
@ 2013-12-12 21:45 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:45 UTC (permalink / raw)
To: Linux USB Mailing List
Cc: linux-samsung-soc, w-kwok2, Felipe Balbi, kgene.kim,
Santosh Shilimkar, Linux OMAP Mailing List,
Linux ARM Kernel Mailing List
A bare-minimum PM implementation which will
server as building block for more complex
PM implementation in the future.
At the least will not leave clocks on unnecessarily
when e.g. a user write mem to /sys/power/state.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
improve error path a little bit.
drivers/usb/dwc3/dwc3-keystone.c | 94 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 91 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 1fad161..3b3761c 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
+#include <linux/pm_runtime.h>
#include <linux/io.h>
#include <linux/of_platform.h>
@@ -118,13 +119,22 @@ static int kdwc3_probe(struct platform_device *pdev)
kdwc->clk = devm_clk_get(kdwc->dev, "usb");
- error = clk_prepare_enable(kdwc->clk);
+ error = clk_prepare(kdwc->clk);
if (error < 0) {
dev_dbg(kdwc->dev, "unable to enable usb clock, err %d\n",
error);
return error;
}
+ pm_runtime_enable(dev);
+
+ error = pm_runtime_get_sync(dev);
+ if (error < 0) {
+ dev_dbg(dev, "unable to pm_runtime_get_sync(), err %d\n",
+ error);
+ goto err_irq;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "missing irq\n");
@@ -151,8 +161,11 @@ static int kdwc3_probe(struct platform_device *pdev)
err_core:
kdwc3_disable_irqs(kdwc);
+
err_irq:
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+ clk_unprepare(kdwc->clk);
return error;
}
@@ -172,7 +185,9 @@ static int kdwc3_remove(struct platform_device *pdev)
kdwc3_disable_irqs(kdwc);
device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ clk_unprepare(kdwc->clk);
platform_set_drvdata(pdev, NULL);
return 0;
@@ -184,6 +199,79 @@ static const struct of_device_id kdwc3_of_match[] = {
};
MODULE_DEVICE_TABLE(of, kdwc3_of_match);
+static int __kdwc3_suspend(struct dwc3_keystone *kdwc)
+{
+ clk_disable(kdwc->clk);
+
+ return 0;
+}
+
+static int __kdwc3_resume(struct dwc3_keystone *kdwc)
+{
+ return clk_enable(kdwc->clk);
+}
+
+static int kdwc3_prepare(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_disable_irqs(kdwc);
+
+ return 0;
+}
+
+static void kdwc3_complete(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_enable_irqs(kdwc);
+}
+
+static int kdwc3_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = __kdwc3_resume(kdwc);
+ if (ret)
+ return ret;
+
+ pm_runtime_disable(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
+ return 0;
+}
+
+static int kdwc3_runtime_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_runtime_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_resume(kdwc);
+}
+
+static const struct dev_pm_ops kdwc3_dev_pm_ops = {
+ .prepare = kdwc3_prepare,
+ .complete = kdwc3_complete,
+
+ SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
+ SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
+};
+
static struct platform_driver kdwc3_driver = {
.probe = kdwc3_probe,
.remove = kdwc3_remove,
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-12 21:45 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:45 UTC (permalink / raw)
To: linux-arm-kernel
A bare-minimum PM implementation which will
server as building block for more complex
PM implementation in the future.
At the least will not leave clocks on unnecessarily
when e.g. a user write mem to /sys/power/state.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
improve error path a little bit.
drivers/usb/dwc3/dwc3-keystone.c | 94 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 91 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 1fad161..3b3761c 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
+#include <linux/pm_runtime.h>
#include <linux/io.h>
#include <linux/of_platform.h>
@@ -118,13 +119,22 @@ static int kdwc3_probe(struct platform_device *pdev)
kdwc->clk = devm_clk_get(kdwc->dev, "usb");
- error = clk_prepare_enable(kdwc->clk);
+ error = clk_prepare(kdwc->clk);
if (error < 0) {
dev_dbg(kdwc->dev, "unable to enable usb clock, err %d\n",
error);
return error;
}
+ pm_runtime_enable(dev);
+
+ error = pm_runtime_get_sync(dev);
+ if (error < 0) {
+ dev_dbg(dev, "unable to pm_runtime_get_sync(), err %d\n",
+ error);
+ goto err_irq;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "missing irq\n");
@@ -151,8 +161,11 @@ static int kdwc3_probe(struct platform_device *pdev)
err_core:
kdwc3_disable_irqs(kdwc);
+
err_irq:
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+ clk_unprepare(kdwc->clk);
return error;
}
@@ -172,7 +185,9 @@ static int kdwc3_remove(struct platform_device *pdev)
kdwc3_disable_irqs(kdwc);
device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
- clk_disable_unprepare(kdwc->clk);
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ clk_unprepare(kdwc->clk);
platform_set_drvdata(pdev, NULL);
return 0;
@@ -184,6 +199,79 @@ static const struct of_device_id kdwc3_of_match[] = {
};
MODULE_DEVICE_TABLE(of, kdwc3_of_match);
+static int __kdwc3_suspend(struct dwc3_keystone *kdwc)
+{
+ clk_disable(kdwc->clk);
+
+ return 0;
+}
+
+static int __kdwc3_resume(struct dwc3_keystone *kdwc)
+{
+ return clk_enable(kdwc->clk);
+}
+
+static int kdwc3_prepare(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_disable_irqs(kdwc);
+
+ return 0;
+}
+
+static void kdwc3_complete(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ kdwc3_enable_irqs(kdwc);
+}
+
+static int kdwc3_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = __kdwc3_resume(kdwc);
+ if (ret)
+ return ret;
+
+ pm_runtime_disable(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
+ return 0;
+}
+
+static int kdwc3_runtime_suspend(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_runtime_resume(struct device *dev)
+{
+ struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+ return __kdwc3_resume(kdwc);
+}
+
+static const struct dev_pm_ops kdwc3_dev_pm_ops = {
+ .prepare = kdwc3_prepare,
+ .complete = kdwc3_complete,
+
+ SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
+ SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
+};
+
static struct platform_driver kdwc3_driver = {
.probe = kdwc3_probe,
.remove = kdwc3_remove,
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 62+ messages in thread
* Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-12 21:45 ` Felipe Balbi
@ 2013-12-12 21:48 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:48 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim, Linux ARM Kernel Mailing List,
linux-samsung-soc, Linux OMAP Mailing List, w-kwok2,
Santosh Shilimkar
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
Hi,
On Thu, Dec 12, 2013 at 03:45:55PM -0600, Felipe Balbi wrote:
> +static const struct dev_pm_ops kdwc3_dev_pm_ops = {
> + .prepare = kdwc3_prepare,
> + .complete = kdwc3_complete,
> +
> + SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
> + SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
> +};
did I really forget to use this ? Wonder why compiler didn't annoy me
:-(
there I go to v3. Will fix in my tree only to avoid the extra traffic in
the mailing list.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-12 21:48 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-12 21:48 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Thu, Dec 12, 2013 at 03:45:55PM -0600, Felipe Balbi wrote:
> +static const struct dev_pm_ops kdwc3_dev_pm_ops = {
> + .prepare = kdwc3_prepare,
> + .complete = kdwc3_complete,
> +
> + SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
> + SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
> +};
did I really forget to use this ? Wonder why compiler didn't annoy me
:-(
there I go to v3. Will fix in my tree only to avoid the extra traffic in
the mailing list.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131212/30f9cdec/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-12 21:45 ` Felipe Balbi
@ 2013-12-13 0:29 ` Santosh Shilimkar
-1 siblings, 0 replies; 62+ messages in thread
From: Santosh Shilimkar @ 2013-12-13 0:29 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim, Linux ARM Kernel Mailing List,
linux-samsung-soc, Linux OMAP Mailing List, w-kwok2
On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> A bare-minimum PM implementation which will
> server as building block for more complex
s/server/serve ;-)
> PM implementation in the future.
>
> At the least will not leave clocks on unnecessarily
> when e.g. a user write mem to /sys/power/state.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
>
> improve error path a little bit.
>
We will test this out. Thanks for the
patch Felipe.
Regards,
Santosh
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 0:29 ` Santosh Shilimkar
0 siblings, 0 replies; 62+ messages in thread
From: Santosh Shilimkar @ 2013-12-13 0:29 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> A bare-minimum PM implementation which will
> server as building block for more complex
s/server/serve ;-)
> PM implementation in the future.
>
> At the least will not leave clocks on unnecessarily
> when e.g. a user write mem to /sys/power/state.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
>
> improve error path a little bit.
>
We will test this out. Thanks for the
patch Felipe.
Regards,
Santosh
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 0:29 ` Santosh Shilimkar
@ 2013-12-13 0:43 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 0:43 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: kgene.kim, w-kwok2, Linux USB Mailing List, Felipe Balbi,
linux-samsung-soc, Linux OMAP Mailing List,
Linux ARM Kernel Mailing List
[-- Attachment #1.1: Type: text/plain, Size: 636 bytes --]
On Thu, Dec 12, 2013 at 07:29:24PM -0500, Santosh Shilimkar wrote:
> On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > A bare-minimum PM implementation which will
> > server as building block for more complex
> s/server/serve ;-)
hah! :-) will fix in my branch.
> > PM implementation in the future.
> >
> > At the least will not leave clocks on unnecessarily
> > when e.g. a user write mem to /sys/power/state.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> >
> > improve error path a little bit.
> >
> We will test this out. Thanks for the
> patch Felipe.
thanks.
--
balbi
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 0:43 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 0:43 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 12, 2013 at 07:29:24PM -0500, Santosh Shilimkar wrote:
> On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > A bare-minimum PM implementation which will
> > server as building block for more complex
> s/server/serve ;-)
hah! :-) will fix in my branch.
> > PM implementation in the future.
> >
> > At the least will not leave clocks on unnecessarily
> > when e.g. a user write mem to /sys/power/state.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> >
> > improve error path a little bit.
> >
> We will test this out. Thanks for the
> patch Felipe.
thanks.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131212/db14b78b/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-13 1:56 ` David Cohen
-1 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-13 1:56 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim, Linux ARM Kernel Mailing List,
linux-samsung-soc, Linux OMAP Mailing List, w-kwok2,
Santosh Shilimkar
On Thu, Dec 12, 2013 at 03:38:41PM -0600, Felipe Balbi wrote:
> teach the PCI glue about pm_runtime so that
> it's easier to teach dwc3 core about it
> later.
>
> No functional changes otherwise.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
I was able to test this one with Intel Merrifield:
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
@ 2013-12-13 1:56 ` David Cohen
0 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-13 1:56 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 12, 2013 at 03:38:41PM -0600, Felipe Balbi wrote:
> teach the PCI glue about pm_runtime so that
> it's easier to teach dwc3 core about it
> later.
>
> No functional changes otherwise.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
I was able to test this one with Intel Merrifield:
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
2013-12-13 1:56 ` David Cohen
@ 2013-12-13 4:17 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 4:17 UTC (permalink / raw)
To: David Cohen
Cc: Felipe Balbi, Linux USB Mailing List, kgene.kim,
Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
On Thu, Dec 12, 2013 at 05:56:05PM -0800, David Cohen wrote:
> On Thu, Dec 12, 2013 at 03:38:41PM -0600, Felipe Balbi wrote:
> > teach the PCI glue about pm_runtime so that
> > it's easier to teach dwc3 core about it
> > later.
> >
> > No functional changes otherwise.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
>
> I was able to test this one with Intel Merrifield:
> Acked-by: David Cohen <david.a.cohen@linux.intel.com>
cool, thanks. Although that'd be a Tested-by. Is it ok to add your name
as Tested-by instead ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
@ 2013-12-13 4:17 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 4:17 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 12, 2013 at 05:56:05PM -0800, David Cohen wrote:
> On Thu, Dec 12, 2013 at 03:38:41PM -0600, Felipe Balbi wrote:
> > teach the PCI glue about pm_runtime so that
> > it's easier to teach dwc3 core about it
> > later.
> >
> > No functional changes otherwise.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
>
> I was able to test this one with Intel Merrifield:
> Acked-by: David Cohen <david.a.cohen@linux.intel.com>
cool, thanks. Although that'd be a Tested-by. Is it ok to add your name
as Tested-by instead ?
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131212/857afe3a/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
2013-12-13 4:17 ` Felipe Balbi
@ 2013-12-13 4:29 ` David Cohen
-1 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-13 4:29 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim, Linux ARM Kernel Mailing List,
linux-samsung-soc, Linux OMAP Mailing List, w-kwok2,
Santosh Shilimkar
On Thu, Dec 12, 2013 at 10:17:19PM -0600, Felipe Balbi wrote:
> On Thu, Dec 12, 2013 at 05:56:05PM -0800, David Cohen wrote:
> > On Thu, Dec 12, 2013 at 03:38:41PM -0600, Felipe Balbi wrote:
> > > teach the PCI glue about pm_runtime so that
> > > it's easier to teach dwc3 core about it
> > > later.
> > >
> > > No functional changes otherwise.
> > >
> > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> >
> > I was able to test this one with Intel Merrifield:
> > Acked-by: David Cohen <david.a.cohen@linux.intel.com>
>
> cool, thanks. Although that'd be a Tested-by. Is it ok to add your name
> as Tested-by instead ?
Yeah :)
Br, David
>
> --
> balbi
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 3/7] usb: dwc3: pci: add pm_runtime support
@ 2013-12-13 4:29 ` David Cohen
0 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-13 4:29 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 12, 2013 at 10:17:19PM -0600, Felipe Balbi wrote:
> On Thu, Dec 12, 2013 at 05:56:05PM -0800, David Cohen wrote:
> > On Thu, Dec 12, 2013 at 03:38:41PM -0600, Felipe Balbi wrote:
> > > teach the PCI glue about pm_runtime so that
> > > it's easier to teach dwc3 core about it
> > > later.
> > >
> > > No functional changes otherwise.
> > >
> > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> >
> > I was able to test this one with Intel Merrifield:
> > Acked-by: David Cohen <david.a.cohen@linux.intel.com>
>
> cool, thanks. Although that'd be a Tested-by. Is it ok to add your name
> as Tested-by instead ?
Yeah :)
Br, David
>
> --
> balbi
^ permalink raw reply [flat|nested] 62+ messages in thread
* RE: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-13 5:01 ` Anton Tikhomirov
-1 siblings, 0 replies; 62+ messages in thread
From: Anton Tikhomirov @ 2013-12-13 5:01 UTC (permalink / raw)
To: 'Felipe Balbi', 'Linux USB Mailing List'
Cc: kgene.kim, 'Linux ARM Kernel Mailing List',
linux-samsung-soc, 'Linux OMAP Mailing List',
w-kwok2, 'Santosh Shilimkar'
Hi Felipe,
> -static int dwc3_exynos_suspend(struct device *dev)
> +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> {
> - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> -
> clk_disable(exynos->clk);
>
> return 0;
> }
>
> +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> +{
> + return clk_enable(exynos->clk);
> +}
> +
> +static int dwc3_exynos_suspend(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> +
> + return __dwc3_exynos_suspend(exynos);
If dwc3-exynos is runtime suspended, the clock will be disabled
second time here (unbalanced clk_enable/clk_disable).
> +}
> +
> static int dwc3_exynos_resume(struct device *dev)
> {
> struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> + int ret;
>
> - clk_enable(exynos->clk);
> + ret = __dwc3_exynos_resume(exynos);
> + if (ret)
> + return ret;
>
> /* runtime set active to reflect active state. */
> pm_runtime_disable(dev);
> @@ -207,8 +238,24 @@ static int dwc3_exynos_resume(struct device *dev)
> return 0;
> }
>
> +static int dwc3_exynos_runtime_suspend(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> +
> + return __dwc3_exynos_suspend(exynos);
> +}
> +
> +static int dwc3_exynos_runtime_resume(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> +
> + return __dwc3_exynos_resume(exynos);
> +}
Thanks
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
@ 2013-12-13 5:01 ` Anton Tikhomirov
0 siblings, 0 replies; 62+ messages in thread
From: Anton Tikhomirov @ 2013-12-13 5:01 UTC (permalink / raw)
To: linux-arm-kernel
Hi Felipe,
> -static int dwc3_exynos_suspend(struct device *dev)
> +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> {
> - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> -
> clk_disable(exynos->clk);
>
> return 0;
> }
>
> +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> +{
> + return clk_enable(exynos->clk);
> +}
> +
> +static int dwc3_exynos_suspend(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> +
> + return __dwc3_exynos_suspend(exynos);
If dwc3-exynos is runtime suspended, the clock will be disabled
second time here (unbalanced clk_enable/clk_disable).
> +}
> +
> static int dwc3_exynos_resume(struct device *dev)
> {
> struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> + int ret;
>
> - clk_enable(exynos->clk);
> + ret = __dwc3_exynos_resume(exynos);
> + if (ret)
> + return ret;
>
> /* runtime set active to reflect active state. */
> pm_runtime_disable(dev);
> @@ -207,8 +238,24 @@ static int dwc3_exynos_resume(struct device *dev)
> return 0;
> }
>
> +static int dwc3_exynos_runtime_suspend(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> +
> + return __dwc3_exynos_suspend(exynos);
> +}
> +
> +static int dwc3_exynos_runtime_resume(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> +
> + return __dwc3_exynos_resume(exynos);
> +}
Thanks
^ permalink raw reply [flat|nested] 62+ messages in thread
* RE: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 0:29 ` Santosh Shilimkar
@ 2013-12-13 16:04 ` Kwok, WingMan
-1 siblings, 0 replies; 62+ messages in thread
From: Kwok, WingMan @ 2013-12-13 16:04 UTC (permalink / raw)
To: Shilimkar, Santosh, Balbi, Felipe
Cc: Linux USB Mailing List, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
Linux ARM Kernel Mailing List,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
Linux OMAP Mailing List
Hello
> -----Original Message-----
> From: Shilimkar, Santosh
> Sent: Thursday, December 12, 2013 7:29 PM
> To: Balbi, Felipe
> Cc: Linux USB Mailing List; kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org; Linux ARM Kernel
> Mailing List; linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Linux OMAP Mailing List;
> Kwok, WingMan
> Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
>
> On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > A bare-minimum PM implementation which will server as building block
> > for more complex
> s/server/serve ;-)
> > PM implementation in the future.
> >
> > At the least will not leave clocks on unnecessarily when e.g. a user
> > write mem to /sys/power/state.
> >
> > Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> > ---
> >
> > improve error path a little bit.
> >
> We will test this out. Thanks for the
> patch Felipe.
>
I have tested the patch and the keystone usb driver continues to function,
though I can't test suspend at this time as the rest of the system does
not that functionality yet.
Thanks
WingMan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 16:04 ` Kwok, WingMan
0 siblings, 0 replies; 62+ messages in thread
From: Kwok, WingMan @ 2013-12-13 16:04 UTC (permalink / raw)
To: linux-arm-kernel
Hello
> -----Original Message-----
> From: Shilimkar, Santosh
> Sent: Thursday, December 12, 2013 7:29 PM
> To: Balbi, Felipe
> Cc: Linux USB Mailing List; kgene.kim at samsung.com; Linux ARM Kernel
> Mailing List; linux-samsung-soc at vger.kernel.org; Linux OMAP Mailing List;
> Kwok, WingMan
> Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
>
> On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > A bare-minimum PM implementation which will server as building block
> > for more complex
> s/server/serve ;-)
> > PM implementation in the future.
> >
> > At the least will not leave clocks on unnecessarily when e.g. a user
> > write mem to /sys/power/state.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> >
> > improve error path a little bit.
> >
> We will test this out. Thanks for the
> patch Felipe.
>
I have tested the patch and the keystone usb driver continues to function,
though I can't test suspend at this time as the rest of the system does
not that functionality yet.
Thanks
WingMan
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 16:04 ` Kwok, WingMan
@ 2013-12-13 19:54 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 19:54 UTC (permalink / raw)
To: Kwok, WingMan
Cc: Shilimkar, Santosh, Balbi, Felipe, Linux USB Mailing List,
kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> Hello
>
> > -----Original Message-----
> > From: Shilimkar, Santosh
> > Sent: Thursday, December 12, 2013 7:29 PM
> > To: Balbi, Felipe
> > Cc: Linux USB Mailing List; kgene.kim@samsung.com; Linux ARM Kernel
> > Mailing List; linux-samsung-soc@vger.kernel.org; Linux OMAP Mailing List;
> > Kwok, WingMan
> > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
> >
> > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > A bare-minimum PM implementation which will server as building block
> > > for more complex
> > s/server/serve ;-)
> > > PM implementation in the future.
> > >
> > > At the least will not leave clocks on unnecessarily when e.g. a user
> > > write mem to /sys/power/state.
> > >
> > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > ---
> > >
> > > improve error path a little bit.
> > >
> > We will test this out. Thanks for the
> > patch Felipe.
> >
>
> I have tested the patch and the keystone usb driver continues to function,
> though I can't test suspend at this time as the rest of the system does
> not that functionality yet.
Thanks, should I add your Tested-by ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 19:54 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 19:54 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> Hello
>
> > -----Original Message-----
> > From: Shilimkar, Santosh
> > Sent: Thursday, December 12, 2013 7:29 PM
> > To: Balbi, Felipe
> > Cc: Linux USB Mailing List; kgene.kim at samsung.com; Linux ARM Kernel
> > Mailing List; linux-samsung-soc at vger.kernel.org; Linux OMAP Mailing List;
> > Kwok, WingMan
> > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
> >
> > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > A bare-minimum PM implementation which will server as building block
> > > for more complex
> > s/server/serve ;-)
> > > PM implementation in the future.
> > >
> > > At the least will not leave clocks on unnecessarily when e.g. a user
> > > write mem to /sys/power/state.
> > >
> > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > ---
> > >
> > > improve error path a little bit.
> > >
> > We will test this out. Thanks for the
> > patch Felipe.
> >
>
> I have tested the patch and the keystone usb driver continues to function,
> though I can't test suspend at this time as the rest of the system does
> not that functionality yet.
Thanks, should I add your Tested-by ?
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131213/921df1ff/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
2013-12-13 5:01 ` Anton Tikhomirov
@ 2013-12-13 19:56 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 19:56 UTC (permalink / raw)
To: Anton Tikhomirov
Cc: 'Felipe Balbi', 'Linux USB Mailing List',
kgene.kim, 'Linux ARM Kernel Mailing List',
linux-samsung-soc, 'Linux OMAP Mailing List',
w-kwok2, 'Santosh Shilimkar'
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> Hi Felipe,
>
> > -static int dwc3_exynos_suspend(struct device *dev)
> > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > {
> > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > -
> > clk_disable(exynos->clk);
> >
> > return 0;
> > }
> >
> > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > +{
> > + return clk_enable(exynos->clk);
> > +}
> > +
> > +static int dwc3_exynos_suspend(struct device *dev)
> > +{
> > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > +
> > + return __dwc3_exynos_suspend(exynos);
>
> If dwc3-exynos is runtime suspended, the clock will be disabled
> second time here (unbalanced clk_enable/clk_disable).
I don't get what you mean but there is something that probably needs
fixing, I guess below makes it better:
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index c93919a..1e5720a 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+ if (pm_runtime_suspended(dev))
+ return 0;
+
return __dwc3_exynos_suspend(exynos);
}
Is that what you meant ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
@ 2013-12-13 19:56 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 19:56 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> Hi Felipe,
>
> > -static int dwc3_exynos_suspend(struct device *dev)
> > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > {
> > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > -
> > clk_disable(exynos->clk);
> >
> > return 0;
> > }
> >
> > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > +{
> > + return clk_enable(exynos->clk);
> > +}
> > +
> > +static int dwc3_exynos_suspend(struct device *dev)
> > +{
> > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > +
> > + return __dwc3_exynos_suspend(exynos);
>
> If dwc3-exynos is runtime suspended, the clock will be disabled
> second time here (unbalanced clk_enable/clk_disable).
I don't get what you mean but there is something that probably needs
fixing, I guess below makes it better:
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index c93919a..1e5720a 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
+ if (pm_runtime_suspended(dev))
+ return 0;
+
return __dwc3_exynos_suspend(exynos);
}
Is that what you meant ?
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131213/b6321c93/attachment-0001.sig>
^ permalink raw reply related [flat|nested] 62+ messages in thread
* Re: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
2013-12-13 19:56 ` Felipe Balbi
@ 2013-12-13 20:18 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 20:18 UTC (permalink / raw)
To: Felipe Balbi
Cc: Anton Tikhomirov, 'Linux USB Mailing List',
kgene.kim, 'Linux ARM Kernel Mailing List',
linux-samsung-soc, 'Linux OMAP Mailing List',
w-kwok2, 'Santosh Shilimkar'
[-- Attachment #1: Type: text/plain, Size: 1944 bytes --]
On Fri, Dec 13, 2013 at 01:56:18PM -0600, Felipe Balbi wrote:
> On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> > Hi Felipe,
> >
> > > -static int dwc3_exynos_suspend(struct device *dev)
> > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > > {
> > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > -
> > > clk_disable(exynos->clk);
> > >
> > > return 0;
> > > }
> > >
> > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > > +{
> > > + return clk_enable(exynos->clk);
> > > +}
> > > +
> > > +static int dwc3_exynos_suspend(struct device *dev)
> > > +{
> > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > +
> > > + return __dwc3_exynos_suspend(exynos);
> >
> > If dwc3-exynos is runtime suspended, the clock will be disabled
> > second time here (unbalanced clk_enable/clk_disable).
>
> I don't get what you mean but there is something that probably needs
> fixing, I guess below makes it better:
>
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index c93919a..1e5720a 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
> {
> struct dwc3_exynos *exynos = dev_get_drvdata(dev);
>
> + if (pm_runtime_suspended(dev))
> + return 0;
> +
> return __dwc3_exynos_suspend(exynos);
> }
>
>
> Is that what you meant ?
note, however, that this is *not* a case where we would fall today. See
that we pm_runtime_get() in probe and only pm_runtime_put() during
remove. So there would never be a case where we would try system suspend
while device was already runtime suspended.
I have fixed all patches in my testing/next branch anyway, just to make
sure we're "idiot-proof" when it comes to implementing real runtime pm
later on :-)
cheers
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
@ 2013-12-13 20:18 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 20:18 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 13, 2013 at 01:56:18PM -0600, Felipe Balbi wrote:
> On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> > Hi Felipe,
> >
> > > -static int dwc3_exynos_suspend(struct device *dev)
> > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > > {
> > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > -
> > > clk_disable(exynos->clk);
> > >
> > > return 0;
> > > }
> > >
> > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > > +{
> > > + return clk_enable(exynos->clk);
> > > +}
> > > +
> > > +static int dwc3_exynos_suspend(struct device *dev)
> > > +{
> > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > +
> > > + return __dwc3_exynos_suspend(exynos);
> >
> > If dwc3-exynos is runtime suspended, the clock will be disabled
> > second time here (unbalanced clk_enable/clk_disable).
>
> I don't get what you mean but there is something that probably needs
> fixing, I guess below makes it better:
>
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index c93919a..1e5720a 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
> {
> struct dwc3_exynos *exynos = dev_get_drvdata(dev);
>
> + if (pm_runtime_suspended(dev))
> + return 0;
> +
> return __dwc3_exynos_suspend(exynos);
> }
>
>
> Is that what you meant ?
note, however, that this is *not* a case where we would fall today. See
that we pm_runtime_get() in probe and only pm_runtime_put() during
remove. So there would never be a case where we would try system suspend
while device was already runtime suspended.
I have fixed all patches in my testing/next branch anyway, just to make
sure we're "idiot-proof" when it comes to implementing real runtime pm
later on :-)
cheers
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131213/7849ea7a/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* RE: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 19:54 ` Felipe Balbi
@ 2013-12-13 20:18 ` Kwok, WingMan
-1 siblings, 0 replies; 62+ messages in thread
From: Kwok, WingMan @ 2013-12-13 20:18 UTC (permalink / raw)
To: Balbi, Felipe
Cc: kgene.kim, Linux USB Mailing List, linux-samsung-soc, Shilimkar,
Santosh, Linux OMAP Mailing List, Linux ARM Kernel Mailing List
> -----Original Message-----
> From: Balbi, Felipe
> Sent: Friday, December 13, 2013 2:55 PM
> To: Kwok, WingMan
> Cc: Shilimkar, Santosh; Balbi, Felipe; Linux USB Mailing List;
> kgene.kim@samsung.com; Linux ARM Kernel Mailing List; linux-samsung-
> soc@vger.kernel.org; Linux OMAP Mailing List
> Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
>
> On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> > Hello
> >
> > > -----Original Message-----
> > > From: Shilimkar, Santosh
> > > Sent: Thursday, December 12, 2013 7:29 PM
> > > To: Balbi, Felipe
> > > Cc: Linux USB Mailing List; kgene.kim@samsung.com; Linux ARM Kernel
> > > Mailing List; linux-samsung-soc@vger.kernel.org; Linux OMAP Mailing
> > > List; Kwok, WingMan
> > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > support
> > >
> > > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > > A bare-minimum PM implementation which will server as building
> > > > block for more complex
> > > s/server/serve ;-)
> > > > PM implementation in the future.
> > > >
> > > > At the least will not leave clocks on unnecessarily when e.g. a
> > > > user write mem to /sys/power/state.
> > > >
> > > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > > ---
> > > >
> > > > improve error path a little bit.
> > > >
> > > We will test this out. Thanks for the patch Felipe.
> > >
> >
> > I have tested the patch and the keystone usb driver continues to
> > function, though I can't test suspend at this time as the rest of the
> > system does not that functionality yet.
>
> Thanks, should I add your Tested-by ?
Yes please.
Thanks
WingMan
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 20:18 ` Kwok, WingMan
0 siblings, 0 replies; 62+ messages in thread
From: Kwok, WingMan @ 2013-12-13 20:18 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Balbi, Felipe
> Sent: Friday, December 13, 2013 2:55 PM
> To: Kwok, WingMan
> Cc: Shilimkar, Santosh; Balbi, Felipe; Linux USB Mailing List;
> kgene.kim at samsung.com; Linux ARM Kernel Mailing List; linux-samsung-
> soc at vger.kernel.org; Linux OMAP Mailing List
> Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
>
> On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> > Hello
> >
> > > -----Original Message-----
> > > From: Shilimkar, Santosh
> > > Sent: Thursday, December 12, 2013 7:29 PM
> > > To: Balbi, Felipe
> > > Cc: Linux USB Mailing List; kgene.kim at samsung.com; Linux ARM Kernel
> > > Mailing List; linux-samsung-soc at vger.kernel.org; Linux OMAP Mailing
> > > List; Kwok, WingMan
> > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > support
> > >
> > > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > > A bare-minimum PM implementation which will server as building
> > > > block for more complex
> > > s/server/serve ;-)
> > > > PM implementation in the future.
> > > >
> > > > At the least will not leave clocks on unnecessarily when e.g. a
> > > > user write mem to /sys/power/state.
> > > >
> > > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > > ---
> > > >
> > > > improve error path a little bit.
> > > >
> > > We will test this out. Thanks for the patch Felipe.
> > >
> >
> > I have tested the patch and the keystone usb driver continues to
> > function, though I can't test suspend at this time as the rest of the
> > system does not that functionality yet.
>
> Thanks, should I add your Tested-by ?
Yes please.
Thanks
WingMan
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 20:18 ` Kwok, WingMan
@ 2013-12-13 20:22 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 20:22 UTC (permalink / raw)
To: Kwok, WingMan
Cc: Balbi, Felipe, Shilimkar, Santosh, Linux USB Mailing List,
kgene.kim, Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List
[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]
On Fri, Dec 13, 2013 at 02:18:42PM -0600, Kwok, WingMan wrote:
>
> > -----Original Message-----
> > From: Balbi, Felipe
> > Sent: Friday, December 13, 2013 2:55 PM
> > To: Kwok, WingMan
> > Cc: Shilimkar, Santosh; Balbi, Felipe; Linux USB Mailing List;
> > kgene.kim@samsung.com; Linux ARM Kernel Mailing List; linux-samsung-
> > soc@vger.kernel.org; Linux OMAP Mailing List
> > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
> >
> > On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> > > Hello
> > >
> > > > -----Original Message-----
> > > > From: Shilimkar, Santosh
> > > > Sent: Thursday, December 12, 2013 7:29 PM
> > > > To: Balbi, Felipe
> > > > Cc: Linux USB Mailing List; kgene.kim@samsung.com; Linux ARM Kernel
> > > > Mailing List; linux-samsung-soc@vger.kernel.org; Linux OMAP Mailing
> > > > List; Kwok, WingMan
> > > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > > support
> > > >
> > > > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > > > A bare-minimum PM implementation which will server as building
> > > > > block for more complex
> > > > s/server/serve ;-)
> > > > > PM implementation in the future.
> > > > >
> > > > > At the least will not leave clocks on unnecessarily when e.g. a
> > > > > user write mem to /sys/power/state.
> > > > >
> > > > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > > > ---
> > > > >
> > > > > improve error path a little bit.
> > > > >
> > > > We will test this out. Thanks for the patch Felipe.
> > > >
> > >
> > > I have tested the patch and the keystone usb driver continues to
> > > function, though I can't test suspend at this time as the rest of the
> > > system does not that functionality yet.
> >
> > Thanks, should I add your Tested-by ?
>
> Yes please.
you need to reply with Tested-by: Your Name <your.email@domain.com> just
to make it all official. Sorry
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 20:22 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-13 20:22 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 13, 2013 at 02:18:42PM -0600, Kwok, WingMan wrote:
>
> > -----Original Message-----
> > From: Balbi, Felipe
> > Sent: Friday, December 13, 2013 2:55 PM
> > To: Kwok, WingMan
> > Cc: Shilimkar, Santosh; Balbi, Felipe; Linux USB Mailing List;
> > kgene.kim at samsung.com; Linux ARM Kernel Mailing List; linux-samsung-
> > soc at vger.kernel.org; Linux OMAP Mailing List
> > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
> >
> > On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> > > Hello
> > >
> > > > -----Original Message-----
> > > > From: Shilimkar, Santosh
> > > > Sent: Thursday, December 12, 2013 7:29 PM
> > > > To: Balbi, Felipe
> > > > Cc: Linux USB Mailing List; kgene.kim at samsung.com; Linux ARM Kernel
> > > > Mailing List; linux-samsung-soc at vger.kernel.org; Linux OMAP Mailing
> > > > List; Kwok, WingMan
> > > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > > support
> > > >
> > > > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > > > A bare-minimum PM implementation which will server as building
> > > > > block for more complex
> > > > s/server/serve ;-)
> > > > > PM implementation in the future.
> > > > >
> > > > > At the least will not leave clocks on unnecessarily when e.g. a
> > > > > user write mem to /sys/power/state.
> > > > >
> > > > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > > > ---
> > > > >
> > > > > improve error path a little bit.
> > > > >
> > > > We will test this out. Thanks for the patch Felipe.
> > > >
> > >
> > > I have tested the patch and the keystone usb driver continues to
> > > function, though I can't test suspend at this time as the rest of the
> > > system does not that functionality yet.
> >
> > Thanks, should I add your Tested-by ?
>
> Yes please.
you need to reply with Tested-by: Your Name <your.email@domain.com> just
to make it all official. Sorry
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131213/6bed2d1d/attachment-0001.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* RE: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 20:22 ` Felipe Balbi
@ 2013-12-13 21:26 ` Kwok, WingMan
-1 siblings, 0 replies; 62+ messages in thread
From: Kwok, WingMan @ 2013-12-13 21:26 UTC (permalink / raw)
To: Balbi, Felipe
Cc: Shilimkar, Santosh, Linux USB Mailing List, kgene.kim,
Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List
> -----Original Message-----
> From: Balbi, Felipe
> Sent: Friday, December 13, 2013 3:23 PM
> To: Kwok, WingMan
> Cc: Balbi, Felipe; Shilimkar, Santosh; Linux USB Mailing List;
> kgene.kim@samsung.com; Linux ARM Kernel Mailing List; linux-samsung-
> soc@vger.kernel.org; Linux OMAP Mailing List
> Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
>
> On Fri, Dec 13, 2013 at 02:18:42PM -0600, Kwok, WingMan wrote:
> >
> > > -----Original Message-----
> > > From: Balbi, Felipe
> > > Sent: Friday, December 13, 2013 2:55 PM
> > > To: Kwok, WingMan
> > > Cc: Shilimkar, Santosh; Balbi, Felipe; Linux USB Mailing List;
> > > kgene.kim@samsung.com; Linux ARM Kernel Mailing List; linux-
> samsung-
> > > soc@vger.kernel.org; Linux OMAP Mailing List
> > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > support
> > >
> > > On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> > > > Hello
> > > >
> > > > > -----Original Message-----
> > > > > From: Shilimkar, Santosh
> > > > > Sent: Thursday, December 12, 2013 7:29 PM
> > > > > To: Balbi, Felipe
> > > > > Cc: Linux USB Mailing List; kgene.kim@samsung.com; Linux ARM
> > > > > Kernel Mailing List; linux-samsung-soc@vger.kernel.org; Linux
> > > > > OMAP Mailing List; Kwok, WingMan
> > > > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > > > support
> > > > >
> > > > > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > > > > A bare-minimum PM implementation which will server as building
> > > > > > block for more complex
> > > > > s/server/serve ;-)
> > > > > > PM implementation in the future.
> > > > > >
> > > > > > At the least will not leave clocks on unnecessarily when e.g.
> > > > > > a user write mem to /sys/power/state.
> > > > > >
> > > > > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > > > > ---
> > > > > >
> > > > > > improve error path a little bit.
> > > > > >
> > > > > We will test this out. Thanks for the patch Felipe.
> > > > >
> > > >
> > > > I have tested the patch and the keystone usb driver continues to
> > > > function, though I can't test suspend at this time as the rest of
> > > > the system does not that functionality yet.
> > >
> > > Thanks, should I add your Tested-by ?
> >
> > Yes please.
>
> you need to reply with Tested-by: Your Name <your.email@domain.com>
> just to make it all official. Sorry
>
Yes, you can add
Tested-by: WingMan Kwok <w-kwok2@ti.com>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 21:26 ` Kwok, WingMan
0 siblings, 0 replies; 62+ messages in thread
From: Kwok, WingMan @ 2013-12-13 21:26 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Balbi, Felipe
> Sent: Friday, December 13, 2013 3:23 PM
> To: Kwok, WingMan
> Cc: Balbi, Felipe; Shilimkar, Santosh; Linux USB Mailing List;
> kgene.kim at samsung.com; Linux ARM Kernel Mailing List; linux-samsung-
> soc at vger.kernel.org; Linux OMAP Mailing List
> Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
>
> On Fri, Dec 13, 2013 at 02:18:42PM -0600, Kwok, WingMan wrote:
> >
> > > -----Original Message-----
> > > From: Balbi, Felipe
> > > Sent: Friday, December 13, 2013 2:55 PM
> > > To: Kwok, WingMan
> > > Cc: Shilimkar, Santosh; Balbi, Felipe; Linux USB Mailing List;
> > > kgene.kim at samsung.com; Linux ARM Kernel Mailing List; linux-
> samsung-
> > > soc at vger.kernel.org; Linux OMAP Mailing List
> > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > support
> > >
> > > On Fri, Dec 13, 2013 at 10:04:38AM -0600, Kwok, WingMan wrote:
> > > > Hello
> > > >
> > > > > -----Original Message-----
> > > > > From: Shilimkar, Santosh
> > > > > Sent: Thursday, December 12, 2013 7:29 PM
> > > > > To: Balbi, Felipe
> > > > > Cc: Linux USB Mailing List; kgene.kim at samsung.com; Linux ARM
> > > > > Kernel Mailing List; linux-samsung-soc at vger.kernel.org; Linux
> > > > > OMAP Mailing List; Kwok, WingMan
> > > > > Subject: Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM
> > > > > support
> > > > >
> > > > > On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
> > > > > > A bare-minimum PM implementation which will server as building
> > > > > > block for more complex
> > > > > s/server/serve ;-)
> > > > > > PM implementation in the future.
> > > > > >
> > > > > > At the least will not leave clocks on unnecessarily when e.g.
> > > > > > a user write mem to /sys/power/state.
> > > > > >
> > > > > > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > > > > > ---
> > > > > >
> > > > > > improve error path a little bit.
> > > > > >
> > > > > We will test this out. Thanks for the patch Felipe.
> > > > >
> > > >
> > > > I have tested the patch and the keystone usb driver continues to
> > > > function, though I can't test suspend at this time as the rest of
> > > > the system does not that functionality yet.
> > >
> > > Thanks, should I add your Tested-by ?
> >
> > Yes please.
>
> you need to reply with Tested-by: Your Name <your.email@domain.com>
> just to make it all official. Sorry
>
Yes, you can add
Tested-by: WingMan Kwok <w-kwok2@ti.com>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
2013-12-13 0:43 ` Felipe Balbi
@ 2013-12-13 23:15 ` Santosh Shilimkar
-1 siblings, 0 replies; 62+ messages in thread
From: Santosh Shilimkar @ 2013-12-13 23:15 UTC (permalink / raw)
To: balbi
Cc: kgene.kim, w-kwok2, Linux USB Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, Linux ARM Kernel Mailing List
On Thursday 12 December 2013 07:43 PM, Felipe Balbi wrote:
> On Thu, Dec 12, 2013 at 07:29:24PM -0500, Santosh Shilimkar wrote:
>> On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
>>> A bare-minimum PM implementation which will
>>> server as building block for more complex
>> s/server/serve ;-)
>
> hah! :-) will fix in my branch.
>
>>> PM implementation in the future.
>>>
>>> At the least will not leave clocks on unnecessarily
>>> when e.g. a user write mem to /sys/power/state.
>>>
>>> Signed-off-by: Felipe Balbi <balbi@ti.com>
>>> ---
>>>
>>> improve error path a little bit.
>>>
>> We will test this out. Thanks for the
>> patch Felipe.
>
I see Wingman already tested the patch.
Feel free add, my ack if you need one...
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH v2 1/7] usb: dwc3: keystone: add basic PM support
@ 2013-12-13 23:15 ` Santosh Shilimkar
0 siblings, 0 replies; 62+ messages in thread
From: Santosh Shilimkar @ 2013-12-13 23:15 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 12 December 2013 07:43 PM, Felipe Balbi wrote:
> On Thu, Dec 12, 2013 at 07:29:24PM -0500, Santosh Shilimkar wrote:
>> On Thursday 12 December 2013 04:45 PM, Felipe Balbi wrote:
>>> A bare-minimum PM implementation which will
>>> server as building block for more complex
>> s/server/serve ;-)
>
> hah! :-) will fix in my branch.
>
>>> PM implementation in the future.
>>>
>>> At the least will not leave clocks on unnecessarily
>>> when e.g. a user write mem to /sys/power/state.
>>>
>>> Signed-off-by: Felipe Balbi <balbi@ti.com>
>>> ---
>>>
>>> improve error path a little bit.
>>>
>> We will test this out. Thanks for the
>> patch Felipe.
>
I see Wingman already tested the patch.
Feel free add, my ack if you need one...
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
^ permalink raw reply [flat|nested] 62+ messages in thread
* RE: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
2013-12-13 19:56 ` Felipe Balbi
@ 2013-12-16 2:31 ` Anton Tikhomirov
-1 siblings, 0 replies; 62+ messages in thread
From: Anton Tikhomirov @ 2013-12-16 2:31 UTC (permalink / raw)
To: balbi-l0cyMroinI0
Cc: 'Linux USB Mailing List',
kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
'Linux ARM Kernel Mailing List',
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
'Linux OMAP Mailing List',
w-kwok2-l0cyMroinI0, 'Santosh Shilimkar'
Hi Felipe,
> On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> > Hi Felipe,
> >
> > > -static int dwc3_exynos_suspend(struct device *dev)
> > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > > {
> > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > -
> > > clk_disable(exynos->clk);
> > >
> > > return 0;
> > > }
> > >
> > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > > +{
> > > + return clk_enable(exynos->clk);
> > > +}
> > > +
> > > +static int dwc3_exynos_suspend(struct device *dev)
> > > +{
> > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > +
> > > + return __dwc3_exynos_suspend(exynos);
> >
> > If dwc3-exynos is runtime suspended, the clock will be disabled
> > second time here (unbalanced clk_enable/clk_disable).
>
> I don't get what you mean but there is something that probably needs
> fixing, I guess below makes it better:
>
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> exynos.c
> index c93919a..1e5720a 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
> {
> struct dwc3_exynos *exynos = dev_get_drvdata(dev);
>
> + if (pm_runtime_suspended(dev))
> + return 0;
> +
> return __dwc3_exynos_suspend(exynos);
> }
>
>
> Is that what you meant ?
Yes, this is exactly what I meant.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
@ 2013-12-16 2:31 ` Anton Tikhomirov
0 siblings, 0 replies; 62+ messages in thread
From: Anton Tikhomirov @ 2013-12-16 2:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi Felipe,
> On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> > Hi Felipe,
> >
> > > -static int dwc3_exynos_suspend(struct device *dev)
> > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > > {
> > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > -
> > > clk_disable(exynos->clk);
> > >
> > > return 0;
> > > }
> > >
> > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > > +{
> > > + return clk_enable(exynos->clk);
> > > +}
> > > +
> > > +static int dwc3_exynos_suspend(struct device *dev)
> > > +{
> > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > +
> > > + return __dwc3_exynos_suspend(exynos);
> >
> > If dwc3-exynos is runtime suspended, the clock will be disabled
> > second time here (unbalanced clk_enable/clk_disable).
>
> I don't get what you mean but there is something that probably needs
> fixing, I guess below makes it better:
>
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> exynos.c
> index c93919a..1e5720a 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
> {
> struct dwc3_exynos *exynos = dev_get_drvdata(dev);
>
> + if (pm_runtime_suspended(dev))
> + return 0;
> +
> return __dwc3_exynos_suspend(exynos);
> }
>
>
> Is that what you meant ?
Yes, this is exactly what I meant.
Thanks.
^ permalink raw reply [flat|nested] 62+ messages in thread
* RE: [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
2013-12-13 20:18 ` Felipe Balbi
@ 2013-12-16 2:47 ` Anton Tikhomirov
-1 siblings, 0 replies; 62+ messages in thread
From: Anton Tikhomirov @ 2013-12-16 2:47 UTC (permalink / raw)
To: balbi
Cc: 'Linux USB Mailing List',
kgene.kim, 'Linux ARM Kernel Mailing List',
linux-samsung-soc, 'Linux OMAP Mailing List',
w-kwok2, 'Santosh Shilimkar'
Hi Felipe,
> On Fri, Dec 13, 2013 at 01:56:18PM -0600, Felipe Balbi wrote:
> > On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> > > Hi Felipe,
> > >
> > > > -static int dwc3_exynos_suspend(struct device *dev)
> > > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > > > {
> > > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > > -
> > > > clk_disable(exynos->clk);
> > > >
> > > > return 0;
> > > > }
> > > >
> > > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > > > +{
> > > > + return clk_enable(exynos->clk);
> > > > +}
> > > > +
> > > > +static int dwc3_exynos_suspend(struct device *dev)
> > > > +{
> > > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > > +
> > > > + return __dwc3_exynos_suspend(exynos);
> > >
> > > If dwc3-exynos is runtime suspended, the clock will be disabled
> > > second time here (unbalanced clk_enable/clk_disable).
> >
> > I don't get what you mean but there is something that probably needs
> > fixing, I guess below makes it better:
> >
> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> exynos.c
> > index c93919a..1e5720a 100644
> > --- a/drivers/usb/dwc3/dwc3-exynos.c
> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
> > @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
> > {
> > struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> >
> > + if (pm_runtime_suspended(dev))
> > + return 0;
> > +
> > return __dwc3_exynos_suspend(exynos);
> > }
> >
> >
> > Is that what you meant ?
>
> note, however, that this is *not* a case where we would fall today. See
> that we pm_runtime_get() in probe and only pm_runtime_put() during
> remove. So there would never be a case where we would try system
> suspend
> while device was already runtime suspended.
You are right, while runtime PM is blocked by get_sync() in probe, this
check
doesn't matter.
>
> I have fixed all patches in my testing/next branch anyway, just to make
> sure we're "idiot-proof" when it comes to implementing real runtime pm
> later on :-)
>
> cheers
>
> --
> balbi
Thank you
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support
@ 2013-12-16 2:47 ` Anton Tikhomirov
0 siblings, 0 replies; 62+ messages in thread
From: Anton Tikhomirov @ 2013-12-16 2:47 UTC (permalink / raw)
To: linux-arm-kernel
Hi Felipe,
> On Fri, Dec 13, 2013 at 01:56:18PM -0600, Felipe Balbi wrote:
> > On Fri, Dec 13, 2013 at 02:01:32PM +0900, Anton Tikhomirov wrote:
> > > Hi Felipe,
> > >
> > > > -static int dwc3_exynos_suspend(struct device *dev)
> > > > +static int __dwc3_exynos_suspend(struct dwc3_exynos *exynos)
> > > > {
> > > > - struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > > -
> > > > clk_disable(exynos->clk);
> > > >
> > > > return 0;
> > > > }
> > > >
> > > > +static int __dwc3_exynos_resume(struct dwc3_exynos *exynos)
> > > > +{
> > > > + return clk_enable(exynos->clk);
> > > > +}
> > > > +
> > > > +static int dwc3_exynos_suspend(struct device *dev)
> > > > +{
> > > > + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> > > > +
> > > > + return __dwc3_exynos_suspend(exynos);
> > >
> > > If dwc3-exynos is runtime suspended, the clock will be disabled
> > > second time here (unbalanced clk_enable/clk_disable).
> >
> > I don't get what you mean but there is something that probably needs
> > fixing, I guess below makes it better:
> >
> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> exynos.c
> > index c93919a..1e5720a 100644
> > --- a/drivers/usb/dwc3/dwc3-exynos.c
> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
> > @@ -218,6 +218,9 @@ static int dwc3_exynos_suspend(struct device *dev)
> > {
> > struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> >
> > + if (pm_runtime_suspended(dev))
> > + return 0;
> > +
> > return __dwc3_exynos_suspend(exynos);
> > }
> >
> >
> > Is that what you meant ?
>
> note, however, that this is *not* a case where we would fall today. See
> that we pm_runtime_get() in probe and only pm_runtime_put() during
> remove. So there would never be a case where we would try system
> suspend
> while device was already runtime suspended.
You are right, while runtime PM is blocked by get_sync() in probe, this
check
doesn't matter.
>
> I have fixed all patches in my testing/next branch anyway, just to make
> sure we're "idiot-proof" when it comes to implementing real runtime pm
> later on :-)
>
> cheers
>
> --
> balbi
Thank you
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 0/7] usb: dwc3: pm_runtime implementation
2013-12-12 21:38 ` Felipe Balbi
@ 2013-12-17 23:31 ` David Cohen
-1 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-17 23:31 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
Linux ARM Kernel Mailing List,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
Linux OMAP Mailing List, w-kwok2-l0cyMroinI0, Santosh Shilimkar
On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> hi all,
>
> these patches add pm_runtime support for all glue layers.
>
> I plan to add pm_runtime support for dwc3 after these
> patches are merged upstream.
>
> Please test.
At first time I failed to notice you were removing #ifdef's around pm
callback functions. Instead of saying DWC3 will start to have warnings
when CONFIG_PM is not selected, I'd say your patch set is now a
dependence of my RFC :)
https://lkml.org/lkml/2013/12/13/4
Br, David Cohen
>
> Felipe Balbi (7):
> usb: dwc3: keystone: add basic PM support
> usb: dwc3: omap: add basic pm_runtime support
> usb: dwc3: pci: add pm_runtime support
> usb: dwc3: omap: fix pm_runtime usage
> usb: dwc3: omap: fix order of pm_runtime vs child removal
> usb: dwc3: exynos: remove DEV_PM_OPS hackery
> usb: dwc3: exynos: add pm_runtime support
>
> drivers/usb/dwc3/dwc3-exynos.c | 73 +++++++++++++++++++++++-------
> drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
> drivers/usb/dwc3/dwc3-omap.c | 45 +++++++++++++++----
> drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++-------
> 4 files changed, 239 insertions(+), 42 deletions(-)
>
> --
> 1.8.4.GIT
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 0/7] usb: dwc3: pm_runtime implementation
@ 2013-12-17 23:31 ` David Cohen
0 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-17 23:31 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> hi all,
>
> these patches add pm_runtime support for all glue layers.
>
> I plan to add pm_runtime support for dwc3 after these
> patches are merged upstream.
>
> Please test.
At first time I failed to notice you were removing #ifdef's around pm
callback functions. Instead of saying DWC3 will start to have warnings
when CONFIG_PM is not selected, I'd say your patch set is now a
dependence of my RFC :)
https://lkml.org/lkml/2013/12/13/4
Br, David Cohen
>
> Felipe Balbi (7):
> usb: dwc3: keystone: add basic PM support
> usb: dwc3: omap: add basic pm_runtime support
> usb: dwc3: pci: add pm_runtime support
> usb: dwc3: omap: fix pm_runtime usage
> usb: dwc3: omap: fix order of pm_runtime vs child removal
> usb: dwc3: exynos: remove DEV_PM_OPS hackery
> usb: dwc3: exynos: add pm_runtime support
>
> drivers/usb/dwc3/dwc3-exynos.c | 73 +++++++++++++++++++++++-------
> drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
> drivers/usb/dwc3/dwc3-omap.c | 45 +++++++++++++++----
> drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++-------
> 4 files changed, 239 insertions(+), 42 deletions(-)
>
> --
> 1.8.4.GIT
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 0/7] usb: dwc3: pm_runtime implementation
2013-12-17 23:31 ` David Cohen
@ 2013-12-17 23:35 ` David Cohen
-1 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-17 23:35 UTC (permalink / raw)
To: Felipe Balbi
Cc: Linux USB Mailing List, kgene.kim, Linux ARM Kernel Mailing List,
linux-samsung-soc, Linux OMAP Mailing List, w-kwok2,
Santosh Shilimkar
On Tue, Dec 17, 2013 at 03:31:40PM -0800, David Cohen wrote:
> On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> > hi all,
> >
> > these patches add pm_runtime support for all glue layers.
> >
> > I plan to add pm_runtime support for dwc3 after these
> > patches are merged upstream.
> >
> > Please test.
>
> At first time I failed to notice you were removing #ifdef's around pm
> callback functions. Instead of saying DWC3 will start to have warnings
> when CONFIG_PM is not selected, I'd say your patch set is now a
> dependence of my RFC :)
I guess I said it in wrong order :P
Your patch set depends on my RFC.
> https://lkml.org/lkml/2013/12/13/4
>
> Br, David Cohen
>
> >
> > Felipe Balbi (7):
> > usb: dwc3: keystone: add basic PM support
> > usb: dwc3: omap: add basic pm_runtime support
> > usb: dwc3: pci: add pm_runtime support
> > usb: dwc3: omap: fix pm_runtime usage
> > usb: dwc3: omap: fix order of pm_runtime vs child removal
> > usb: dwc3: exynos: remove DEV_PM_OPS hackery
> > usb: dwc3: exynos: add pm_runtime support
> >
> > drivers/usb/dwc3/dwc3-exynos.c | 73 +++++++++++++++++++++++-------
> > drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
> > drivers/usb/dwc3/dwc3-omap.c | 45 +++++++++++++++----
> > drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++-------
> > 4 files changed, 239 insertions(+), 42 deletions(-)
> >
> > --
> > 1.8.4.GIT
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 0/7] usb: dwc3: pm_runtime implementation
@ 2013-12-17 23:35 ` David Cohen
0 siblings, 0 replies; 62+ messages in thread
From: David Cohen @ 2013-12-17 23:35 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Dec 17, 2013 at 03:31:40PM -0800, David Cohen wrote:
> On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> > hi all,
> >
> > these patches add pm_runtime support for all glue layers.
> >
> > I plan to add pm_runtime support for dwc3 after these
> > patches are merged upstream.
> >
> > Please test.
>
> At first time I failed to notice you were removing #ifdef's around pm
> callback functions. Instead of saying DWC3 will start to have warnings
> when CONFIG_PM is not selected, I'd say your patch set is now a
> dependence of my RFC :)
I guess I said it in wrong order :P
Your patch set depends on my RFC.
> https://lkml.org/lkml/2013/12/13/4
>
> Br, David Cohen
>
> >
> > Felipe Balbi (7):
> > usb: dwc3: keystone: add basic PM support
> > usb: dwc3: omap: add basic pm_runtime support
> > usb: dwc3: pci: add pm_runtime support
> > usb: dwc3: omap: fix pm_runtime usage
> > usb: dwc3: omap: fix order of pm_runtime vs child removal
> > usb: dwc3: exynos: remove DEV_PM_OPS hackery
> > usb: dwc3: exynos: add pm_runtime support
> >
> > drivers/usb/dwc3/dwc3-exynos.c | 73 +++++++++++++++++++++++-------
> > drivers/usb/dwc3/dwc3-keystone.c | 97 ++++++++++++++++++++++++++++++++++++++--
> > drivers/usb/dwc3/dwc3-omap.c | 45 +++++++++++++++----
> > drivers/usb/dwc3/dwc3-pci.c | 66 ++++++++++++++++++++-------
> > 4 files changed, 239 insertions(+), 42 deletions(-)
> >
> > --
> > 1.8.4.GIT
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> > the body of a message to majordomo at vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 0/7] usb: dwc3: pm_runtime implementation
2013-12-17 23:35 ` David Cohen
@ 2013-12-18 15:36 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-18 15:36 UTC (permalink / raw)
To: David Cohen
Cc: kgene.kim, w-kwok2, Linux USB Mailing List, Felipe Balbi,
linux-samsung-soc, Santosh Shilimkar, Linux OMAP Mailing List,
Linux ARM Kernel Mailing List
[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]
Hi,
On Tue, Dec 17, 2013 at 03:35:54PM -0800, David Cohen wrote:
> On Tue, Dec 17, 2013 at 03:31:40PM -0800, David Cohen wrote:
> > On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> > > hi all,
> > >
> > > these patches add pm_runtime support for all glue layers.
> > >
> > > I plan to add pm_runtime support for dwc3 after these
> > > patches are merged upstream.
> > >
> > > Please test.
> >
> > At first time I failed to notice you were removing #ifdef's around pm
> > callback functions. Instead of saying DWC3 will start to have warnings
> > when CONFIG_PM is not selected, I'd say your patch set is now a
> > dependence of my RFC :)
>
> I guess I said it in wrong order :P
> Your patch set depends on my RFC.
Or I just modify my patchset a little bit for now ;-)
--
balbi
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 0/7] usb: dwc3: pm_runtime implementation
@ 2013-12-18 15:36 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-18 15:36 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Dec 17, 2013 at 03:35:54PM -0800, David Cohen wrote:
> On Tue, Dec 17, 2013 at 03:31:40PM -0800, David Cohen wrote:
> > On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> > > hi all,
> > >
> > > these patches add pm_runtime support for all glue layers.
> > >
> > > I plan to add pm_runtime support for dwc3 after these
> > > patches are merged upstream.
> > >
> > > Please test.
> >
> > At first time I failed to notice you were removing #ifdef's around pm
> > callback functions. Instead of saying DWC3 will start to have warnings
> > when CONFIG_PM is not selected, I'd say your patch set is now a
> > dependence of my RFC :)
>
> I guess I said it in wrong order :P
> Your patch set depends on my RFC.
Or I just modify my patchset a little bit for now ;-)
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131218/26000716/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [PATCH 0/7] usb: dwc3: pm_runtime implementation
2013-12-18 15:36 ` Felipe Balbi
@ 2013-12-18 15:40 ` Felipe Balbi
-1 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-18 15:40 UTC (permalink / raw)
To: Felipe Balbi
Cc: David Cohen, Linux USB Mailing List, kgene.kim,
Linux ARM Kernel Mailing List, linux-samsung-soc,
Linux OMAP Mailing List, w-kwok2, Santosh Shilimkar
[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]
On Wed, Dec 18, 2013 at 09:36:14AM -0600, Felipe Balbi wrote:
> Hi,
>
> On Tue, Dec 17, 2013 at 03:35:54PM -0800, David Cohen wrote:
> > On Tue, Dec 17, 2013 at 03:31:40PM -0800, David Cohen wrote:
> > > On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> > > > hi all,
> > > >
> > > > these patches add pm_runtime support for all glue layers.
> > > >
> > > > I plan to add pm_runtime support for dwc3 after these
> > > > patches are merged upstream.
> > > >
> > > > Please test.
> > >
> > > At first time I failed to notice you were removing #ifdef's around pm
> > > callback functions. Instead of saying DWC3 will start to have warnings
> > > when CONFIG_PM is not selected, I'd say your patch set is now a
> > > dependence of my RFC :)
> >
> > I guess I said it in wrong order :P
> > Your patch set depends on my RFC.
>
> Or I just modify my patchset a little bit for now ;-)
nah, it looks horrible with all those ifdefs around. I'll delay my
patch series.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 0/7] usb: dwc3: pm_runtime implementation
@ 2013-12-18 15:40 ` Felipe Balbi
0 siblings, 0 replies; 62+ messages in thread
From: Felipe Balbi @ 2013-12-18 15:40 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Dec 18, 2013 at 09:36:14AM -0600, Felipe Balbi wrote:
> Hi,
>
> On Tue, Dec 17, 2013 at 03:35:54PM -0800, David Cohen wrote:
> > On Tue, Dec 17, 2013 at 03:31:40PM -0800, David Cohen wrote:
> > > On Thu, Dec 12, 2013 at 03:38:38PM -0600, Felipe Balbi wrote:
> > > > hi all,
> > > >
> > > > these patches add pm_runtime support for all glue layers.
> > > >
> > > > I plan to add pm_runtime support for dwc3 after these
> > > > patches are merged upstream.
> > > >
> > > > Please test.
> > >
> > > At first time I failed to notice you were removing #ifdef's around pm
> > > callback functions. Instead of saying DWC3 will start to have warnings
> > > when CONFIG_PM is not selected, I'd say your patch set is now a
> > > dependence of my RFC :)
> >
> > I guess I said it in wrong order :P
> > Your patch set depends on my RFC.
>
> Or I just modify my patchset a little bit for now ;-)
nah, it looks horrible with all those ifdefs around. I'll delay my
patch series.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131218/80debeb2/attachment.sig>
^ permalink raw reply [flat|nested] 62+ messages in thread
end of thread, other threads:[~2013-12-18 15:41 UTC | newest]
Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12 21:38 [PATCH 0/7] usb: dwc3: pm_runtime implementation Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-12 21:38 ` [PATCH 1/7] usb: dwc3: keystone: add basic PM support Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-12 21:43 ` Felipe Balbi
2013-12-12 21:43 ` Felipe Balbi
2013-12-12 21:45 ` [PATCH v2 " Felipe Balbi
2013-12-12 21:45 ` Felipe Balbi
2013-12-12 21:48 ` Felipe Balbi
2013-12-12 21:48 ` Felipe Balbi
2013-12-13 0:29 ` Santosh Shilimkar
2013-12-13 0:29 ` Santosh Shilimkar
2013-12-13 0:43 ` Felipe Balbi
2013-12-13 0:43 ` Felipe Balbi
2013-12-13 23:15 ` Santosh Shilimkar
2013-12-13 23:15 ` Santosh Shilimkar
[not found] ` <52AA54E4.5000606-l0cyMroinI0@public.gmane.org>
2013-12-13 16:04 ` Kwok, WingMan
2013-12-13 16:04 ` Kwok, WingMan
2013-12-13 19:54 ` Felipe Balbi
2013-12-13 19:54 ` Felipe Balbi
2013-12-13 20:18 ` Kwok, WingMan
2013-12-13 20:18 ` Kwok, WingMan
2013-12-13 20:22 ` Felipe Balbi
2013-12-13 20:22 ` Felipe Balbi
2013-12-13 21:26 ` Kwok, WingMan
2013-12-13 21:26 ` Kwok, WingMan
2013-12-12 21:38 ` [PATCH 2/7] usb: dwc3: omap: add basic pm_runtime support Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-12 21:38 ` [PATCH 4/7] usb: dwc3: omap: fix pm_runtime usage Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
[not found] ` <1386884325-11440-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2013-12-12 21:38 ` [PATCH 3/7] usb: dwc3: pci: add pm_runtime support Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-13 1:56 ` David Cohen
2013-12-13 1:56 ` David Cohen
2013-12-13 4:17 ` Felipe Balbi
2013-12-13 4:17 ` Felipe Balbi
2013-12-13 4:29 ` David Cohen
2013-12-13 4:29 ` David Cohen
2013-12-12 21:38 ` [PATCH 5/7] usb: dwc3: omap: fix order of pm_runtime vs child removal Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-17 23:31 ` [PATCH 0/7] usb: dwc3: pm_runtime implementation David Cohen
2013-12-17 23:31 ` David Cohen
2013-12-17 23:35 ` David Cohen
2013-12-17 23:35 ` David Cohen
2013-12-18 15:36 ` Felipe Balbi
2013-12-18 15:36 ` Felipe Balbi
2013-12-18 15:40 ` Felipe Balbi
2013-12-18 15:40 ` Felipe Balbi
2013-12-12 21:38 ` [PATCH 6/7] usb: dwc3: exynos: remove DEV_PM_OPS hackery Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-12 21:38 ` [PATCH 7/7] usb: dwc3: exynos: add pm_runtime support Felipe Balbi
2013-12-12 21:38 ` Felipe Balbi
2013-12-13 5:01 ` Anton Tikhomirov
2013-12-13 5:01 ` Anton Tikhomirov
2013-12-13 19:56 ` Felipe Balbi
2013-12-13 19:56 ` Felipe Balbi
2013-12-13 20:18 ` Felipe Balbi
2013-12-13 20:18 ` Felipe Balbi
2013-12-16 2:47 ` Anton Tikhomirov
2013-12-16 2:47 ` Anton Tikhomirov
[not found] ` <20131213195618.GG5292-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2013-12-16 2:31 ` Anton Tikhomirov
2013-12-16 2:31 ` Anton Tikhomirov
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.