From: Felipe Balbi <balbi@ti.com>
To: Vivek Gautam <gautam.vivek@samsung.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-omap@vger.kernel.org>, <linux-samsung-soc@vger.kernel.org>,
<gregkh@linuxfoundation.org>, <balbi@ti.com>,
<sarah.a.sharp@linux.intel.com>, <kgene.kim@samsung.com>,
<dianders@chromium.org>, <sylvester.nawrocki@gmail.com>,
<tomasz.figa@gmail.com>
Subject: Re: [PATCH 3/4] usb: dwc3: exynos: Enable runtime power management
Date: Mon, 28 Jan 2013 13:47:55 +0200 [thread overview]
Message-ID: <20130128114755.GF28698@arwen.pp.htv.fi> (raw)
In-Reply-To: <1359373348-18320-4-git-send-email-gautam.vivek@samsung.com>
[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]
On Mon, Jan 28, 2013 at 05:12:27PM +0530, Vivek Gautam wrote:
> Enabling runtime power management on dwc3-exynos to save
> power and allow its PHY's power to be managed at runtime.
>
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> drivers/usb/dwc3/dwc3-exynos.c | 47 ++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 47 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index aae5328..c51e8c1 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -157,11 +157,15 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
> goto err4;
> }
>
> + pm_runtime_set_active(&pdev->dev);
> + pm_runtime_enable(&pdev->dev);
> +
> return 0;
>
> err4:
> clk_disable(clk);
> clk_put(clk);
> + pm_runtime_disable(&pdev->dev);
> err3:
> platform_device_put(dwc3);
> err1:
> @@ -174,6 +178,8 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
> {
> struct dwc3_exynos *exynos = platform_get_drvdata(pdev);
>
> + pm_runtime_disable(&pdev->dev);
> +
> platform_device_unregister(exynos->dwc3);
> platform_device_unregister(exynos->usb2_phy);
> platform_device_unregister(exynos->usb3_phy);
> @@ -186,6 +192,46 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static int dwc3_exynos_runtime_suspend(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> + struct platform_device *pdev_dwc = exynos->dwc3;
> + struct dwc3 *dwc = NULL;
> +
> + dwc = platform_get_drvdata(pdev_dwc);
> +
> + if (!dwc)
> + return 0;
> +
> + pm_runtime_put_sync(dwc->usb3_phy->dev);
> +
> + clk_disable(exynos->clk);
> +
> + return 0;
> +}
> +static int dwc3_exynos_runtime_resume(struct device *dev)
> +{
> + struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> + struct platform_device *pdev_dwc = exynos->dwc3;
> + struct dwc3 *dwc = NULL;
> +
> + dwc = platform_get_drvdata(pdev_dwc);
> +
> + clk_enable(exynos->clk);
> +
> + if (!dwc)
> + return 0;
> +
> + pm_runtime_get_sync(dwc->usb3_phy->dev);
dude, this is wrong :-)
look at this:
pm_runtime_get() -> dwc3_exynos_runtime_resume() ->
pm_runtime_get_sync() -> dwc3_exynos_runtime_resume() -> ...
only your clock enalbe should do
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-01-28 11:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-28 11:42 [PATCH 0/4] usb: dwc3/xhci: " Vivek Gautam
2013-01-28 11:42 ` [PATCH 1/4] usb: xhci: Enable runtime pm in xhci-plat Vivek Gautam
2013-01-28 11:42 ` [PATCH 2/4] USB: dwc3: Adjust runtime pm the dwc3 driver to allow runtime suspend Vivek Gautam
2013-01-28 11:45 ` Felipe Balbi
2013-01-28 13:36 ` Vivek Gautam
2013-02-27 8:06 ` Felipe Balbi
2013-02-27 8:53 ` Vivek Gautam
2013-01-28 11:42 ` [PATCH 3/4] usb: dwc3: exynos: Enable runtime power management Vivek Gautam
2013-01-28 11:47 ` Felipe Balbi [this message]
2013-01-28 11:58 ` Vivek Gautam
2013-01-28 12:12 ` Felipe Balbi
2013-01-28 12:27 ` Vivek Gautam
2013-01-28 12:29 ` Felipe Balbi
2013-01-28 11:42 ` [PATCH 4/4] usb: phy: samsung: Enable runtime power management on samsung-usb3 Vivek Gautam
2013-01-28 12:09 ` Felipe Balbi
2013-01-28 13:04 ` Vivek Gautam
2013-01-28 13:07 ` Felipe Balbi
2013-01-28 13:24 ` Vivek Gautam
2013-01-28 13:25 ` Felipe Balbi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130128114755.GF28698@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=dianders@chromium.org \
--cc=gautam.vivek@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=kgene.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=sylvester.nawrocki@gmail.com \
--cc=tomasz.figa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®