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: 8574331 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 32B69C0553 for ; Mon, 14 Mar 2016 00:07:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EDCE20454 for ; Mon, 14 Mar 2016 00:07:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C7F62044C for ; Mon, 14 Mar 2016 00:07:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754438AbcCNAHb (ORCPT ); Sun, 13 Mar 2016 20:07:31 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:18422 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbcCNAHa (ORCPT ); Sun, 13 Mar 2016 20:07:30 -0400 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>; 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 Cc: Alan Stern , Krzysztof Kozlowski 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= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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; }