From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Vinod Koul <vkoul@kernel.org>,
dmaengine@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH 1/2] dmaengine: pl330: Drop boilerplate code for suspend/resume
Date: Fri, 6 Dec 2019 12:46:12 +0100 [thread overview]
Message-ID: <d413878c-1383-7964-1f94-d35dbb0b07d8@samsung.com> (raw)
In-Reply-To: <20191205143746.24873-2-ulf.hansson@linaro.org>
Hi Ulf,
On 05.12.2019 15:37, Ulf Hansson wrote:
> Let's drop the boilerplate code in the system suspend/resume callbacks and
> convert to use pm_runtime_force_suspend|resume(). This change also has a
> nice side effect, as pm_runtime_force_resume() may decide to leave the
> device in low power state, when that is feasible, thus avoiding to waste
> both time and energy during system resume.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Works fine on various Samsung Exynos boards I have for tests.
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/dma/pl330.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 6cce9ef61b29..8e01da157518 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2961,12 +2961,7 @@ static int __maybe_unused pl330_suspend(struct device *dev)
> {
> struct amba_device *pcdev = to_amba_device(dev);
>
> - pm_runtime_disable(dev);
> -
> - if (!pm_runtime_status_suspended(dev)) {
> - /* amba did not disable the clock */
> - amba_pclk_disable(pcdev);
> - }
> + pm_runtime_force_suspend(dev);
> amba_pclk_unprepare(pcdev);
>
> return 0;
> @@ -2981,10 +2976,7 @@ static int __maybe_unused pl330_resume(struct device *dev)
> if (ret)
> return ret;
>
> - if (!pm_runtime_status_suspended(dev))
> - ret = amba_pclk_enable(pcdev);
> -
> - pm_runtime_enable(dev);
> + pm_runtime_force_resume(dev);
>
> return ret;
> }
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-06 11:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 14:37 [PATCH 0/2] dmaengine: pl330: A few system suspend/resume changes Ulf Hansson
2019-12-05 14:37 ` [PATCH 1/2] dmaengine: pl330: Drop boilerplate code for suspend/resume Ulf Hansson
2019-12-06 11:46 ` Marek Szyprowski [this message]
2019-12-05 14:37 ` [PATCH 2/2] dmaengine: pl330: Convert to the *_late and *_early system sleep callbacks Ulf Hansson
2019-12-06 11:46 ` Marek Szyprowski
2019-12-10 6:09 ` [PATCH 0/2] dmaengine: pl330: A few system suspend/resume changes Vinod Koul
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=d413878c-1383-7964-1f94-d35dbb0b07d8@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=dmaengine@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).