From patchwork Mon Mar 14 00:07:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 8574431 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@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 8F58F9F758 for ; Mon, 14 Mar 2016 00:08:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDB5E2044C for ; Mon, 14 Mar 2016 00:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 804CD2045E for ; Mon, 14 Mar 2016 00:08:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932908AbcCNAHr (ORCPT ); Sun, 13 Mar 2016 20:07:47 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:18429 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754570AbcCNAHh (ORCPT ); Sun, 13 Mar 2016 20:07:37 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O4000MFX5ON3F00@mailout3.w1.samsung.com>; Mon, 14 Mar 2016 00:07:35 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-2a-56e600c6636f Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 6C.13.21385.6C006E65; Mon, 14 Mar 2016 00:07:34 +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:34 +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 4/4] hwrng: exynos - Disable runtime PM on driver unbind Date: Mon, 14 Mar 2016 09:07:15 +0900 Message-id: <1457914035-26856-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 2.5.0 In-reply-to: <1457914035-26856-1-git-send-email-k.kozlowski@samsung.com> References: <1457914035-26856-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMLMWRmVeSWpSXmKPExsVy+t/xa7rHGJ6FGdx/b2jR/UrG4vULQ4v+ x6+ZLTY9vsZqcf/eTyaLy7vmsFnMOL+PyWLBtj5Giwm/L7A5cHpsO6DqsWlVJ5vH5iX1HrPv /mD06NuyCki83MDo8XmTXAB7FJdNSmpOZllqkb5dAlfGjRNvmQv+cVW09Bk2MC7l7GLk5JAQ MJFYtO4DG4QtJnHh3nogm4tDSGApo8SmH9ugnP+MEpevvgarYhMwlti8fAlYQkTgG6PEj4fn GEESzALREq96H4HZwgLeEid//mIHsVkEVCV+T1jFDGLzCrhLrPs7DaiGA2idnMSCC+kgYU4B D4lDK9aDlQsBlVzY+5l9AiPvAkaGVYyiqaXJBcVJ6blGesWJucWleel6yfm5mxghQfd1B+PS Y1aHGAU4GJV4eH+seRomxJpYVlyZe4hRgoNZSYR33n+gEG9KYmVValF+fFFpTmrxIUZpDhYl cd6Zu96HCAmkJ5akZqemFqQWwWSZODilGhhXrxGKn3vA8K1wiZCwXxzD8qA3XgVBUpabttQe C5urILPZ/MtM55Npfgcs3ZhLb6xboLB092K5Q+4HGFe1V1gnX1E8tGrrzabK5UE25dvP8Ly/ 8uaKyIXvTvn+juIXrnP1l9ZdEDH56vP8UOV9k3jbBz8r20PuKfI9brbrbqjd6myTb83SHqPE UpyRaKjFXFScCADJFHJzNgIAAA== 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 Driver enabled runtime PM but did not revert this on removal. Re-binding of a device triggered warning: exynos-rng 10830400.rng: Unbalanced pm_runtime_enable! Fixes: b329669ea0b5 ("hwrng: exynos - Add support for Exynos random number generator") Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Call also pm_runtime_dont_use_autosuspend() to revert everything set during probe. --- drivers/char/hw_random/exynos-rng.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index 71b45b153cf2..ed78f25e4ec6 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c @@ -156,6 +156,14 @@ static int exynos_rng_probe(struct platform_device *pdev) return ret; } +static int exynos_rng_remove(struct platform_device *pdev) +{ + pm_runtime_dont_use_autosuspend(&pdev->dev); + pm_runtime_disable(&pdev->dev); + + return 0; +} + static int __maybe_unused exynos_rng_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -213,6 +221,7 @@ static struct platform_driver exynos_rng_driver = { .of_match_table = exynos_rng_dt_match, }, .probe = exynos_rng_probe, + .remove = exynos_rng_remove, }; module_platform_driver(exynos_rng_driver);