From patchwork Fri Mar 11 07:49:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 8562861 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 D9E1EC0553 for ; Fri, 11 Mar 2016 07:50:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1BF612026D for ; Fri, 11 Mar 2016 07:50:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13FB520375 for ; Fri, 11 Mar 2016 07:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934320AbcCKHuf (ORCPT ); Fri, 11 Mar 2016 02:50:35 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:10453 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934287AbcCKHtl (ORCPT ); Fri, 11 Mar 2016 02:49:41 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O3V00B9F72QHJ60@mailout2.w1.samsung.com>; Fri, 11 Mar 2016 07:49:38 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-5e-56e27892ebfe Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 9A.5F.21385.29872E65; Fri, 11 Mar 2016 07:49:38 +0000 (GMT) Received: from localhost.localdomain ([10.113.63.52]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O3V00KWE72HYU40@eusync2.samsung.com>; Fri, 11 Mar 2016 07:49:38 +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: Krzysztof Kozlowski Subject: [PATCH 2/5] hwrng: exynos - Runtime suspend device after init Date: Fri, 11 Mar 2016 16:49:19 +0900 Message-id: <1457682562-21219-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 2.5.0 In-reply-to: <1457682562-21219-1-git-send-email-k.kozlowski@samsung.com> References: <1457682562-21219-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFLMWRmVeSWpSXmKPExsVy+t/xK7qTKh6FGZz7J2/R/UrG4vULQ4v+ x6+ZLTY9vsZqcf/eTyaLy7vmsFnMOL+PyWLBtj5GBw6PbQdUPTat6mTz2Lyk3qNvyypGj76X Gxg9Pm+SC2CL4rJJSc3JLEst0rdL4MqYs+EOY8EtjopXe44yNzDuYO9i5OSQEDCR+L10OhOE LSZx4d56ti5GLg4hgaWMEg9vXGWHcP4zSvT/PsoGUsUmYCyxefkSsCoRgW+MEj8enmMESTAL GEr8fPcHbKywgJvE2XVTweIsAqoSG9dtZAaxeQXcJdY++gxUwwG0Tk5iwYV0kDCngIdE45ZP YPOFgEpW3jzKNoGRdwEjwypG0dTS5ILipPRcI73ixNzi0rx0veT83E2MkBD7uoNx6TGrQ4wC HIxKPLwfrj0ME2JNLCuuzD3EKMHBrCTCm1n8KEyINyWxsiq1KD++qDQntfgQozQHi5I478xd 70OEBNITS1KzU1MLUotgskwcnFINjEUafrET1HUftOjJxbfEcZQkdd50eDPBNufJs++FfUG9 s7Z7vX6vcGRfwKdFK44kKSVsmMRxbadStfjO2OOCBts9Hm+57VhpuDib7Vbwopl7bWcYOGyw K2b+fTppv4b1NE/VQwetZnN+n6chKeM+OUT63OrLTP87Mq6x5dzSfcrCF79QJPh7thJLcUai oRZzUXEiAGdlB/AtAgAA 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 --- 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; }