From patchwork Mon Mar 14 00:07:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 8574451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 97B159F6E1 for ; Mon, 14 Mar 2016 00:09:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA5452045E for ; Mon, 14 Mar 2016 00:09:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFD432044C for ; Mon, 14 Mar 2016 00:09:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1afG38-0002zl-V0; Mon, 14 Mar 2016 00:07:54 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1afG35-0002y7-G3 for linux-arm-kernel@lists.infradead.org; Mon, 14 Mar 2016 00:07:52 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O40000EH5OEYT00@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 14 Mar 2016 00:07:26 +0000 (GMT) X-AuditID: cbfec7f4-f79026d00000418a-25-56e600bebb43 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id BF.EA.16778.EB006E65; Mon, 14 Mar 2016 00:07:26 +0000 (GMT) Received: from localhost.localdomain ([10.113.63.52]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O4000AG95O6YG70@eusync4.samsung.com>; Mon, 14 Mar 2016 00:07:26 +0000 (GMT) From: Krzysztof Kozlowski To: Matt Mackall , Herbert Xu , Kukjin Kim , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] hwrng: exynos - Runtime suspend device after init Date: Mon, 14 Mar 2016 09:07:12 +0900 Message-id: <1457914035-26856-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 2.5.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e/4Nd19DM/CDC48E7LofiVj8fqFoUX/ 49fMFpseX2O1uH/vJ5PF5V1z2CxmnN/HZLFgWx+jxYTfF9gcOD22HVD12LSqk81j85J6j9l3 fzB69G1ZBSRebmD0+LxJLoA9issmJTUnsyy1SN8ugSvj754tLAUNnBVvX35mb2C8yN7FyMkh IWAi8b91OzOELSZx4d56ti5GLg4hgaWMEvc2vWSGcP4zSvy8d5wNpIpNwFhi8/IlYFUiAt8Y JX48PMcIkmAWiJZ41fsIzBYW8JRYsf0Y2AoWAVWJGWvuAE3i4OAVcJc4NMMWxJQQkJNYcCF9 AiP3AkaGVYyiqaXJBcVJ6bmGesWJucWleel6yfm5mxghQfRlB+PiY1aHGAU4GJV4eH+seRom xJpYVlyZe4hRgoNZSYR33n+gEG9KYmVValF+fFFpTmrxIUZpDhYlcd65u96HCAmkJ5akZqem FqQWwWSZODilGhiNz6vHrt9Scv6lD+e3hV6rzl28kl27ZpXK5dTrD6TUzZ5kT3lcu9P9VhT/ qV1zT7OZ3fyQbHBsQ1zZN1X/KLGzoXfEupQjhT/8uVX4qKFL8HLbn88xP+KOhD44drTJzHn3 zxJNtkc121tilC81ThZ8nPVNw1C49P+5/WpmE7/FTL0m+XStXrGpEktxRqKhFnNRcSIASG36 th4CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160313_170751_700860_D9714C02 X-CRM114-Status: GOOD ( 14.36 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , Alan Stern MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver uses pm_runtime_put_noidle() after initialization so the device might remain in active state if the core does not read from it (the read callback contains regular runtime put). The put_noidle() was chosen probably to avoid unneeded suspend and resume cycle after the initialization. However for this purpose autosuspend is enabled so it is safe to runtime put just after the initialization. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. None. --- drivers/char/hw_random/exynos-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index ada081232528..d1fd21e99368 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c @@ -77,7 +77,8 @@ static int exynos_init(struct hwrng *rng) pm_runtime_get_sync(exynos_rng->dev); ret = exynos_rng_configure(exynos_rng); - pm_runtime_put_noidle(exynos_rng->dev); + pm_runtime_mark_last_busy(exynos_rng->dev); + pm_runtime_put_autosuspend(exynos_rng->dev); return ret; }