From patchwork Fri Oct 16 16:01:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 7418251 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 7F322BEEA4 for ; Fri, 16 Oct 2015 16:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC9CE20A79 for ; Fri, 16 Oct 2015 16:02:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19EAC208E1 for ; Fri, 16 Oct 2015 16:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932130AbbJPQCg (ORCPT ); Fri, 16 Oct 2015 12:02:36 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34460 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932839AbbJPQCO (ORCPT ); Fri, 16 Oct 2015 12:02:14 -0400 Received: by wicgb1 with SMTP id gb1so15409935wic.1 for ; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B+LwHx2I48zREshDrzldo/rVWuY2ah/Lv4fOxnLaGdA=; b=P4B3oreiT3YFten9bgj5CLyuCU+9tgdNTRjkFDH9R9owGh6OU4p69yZ/1trDagGokF HYZi4AP4mjV9x1hmd7on6O4sbrbzdj7sF4wU9O1aaLogdpA2WuOeeSonB4SHk4f3SCf2 3v12GlvIEf48+wuejGTWPWvZW4huWQClHq2Z3jDLWJjeT6Ll9V8niP+vA0BnSgreuqaM 9/WScifAEwEO1cgqPn8FgBqDVIbTlT2QN8Z6XRRlx4XNHZHcI0Hm0ZJd2/brtMFawN7M KqzPyFvCATZ7pEz0RC1kpjEhvu3iRqovqfldCYq+h30tEzBFMRiWcLnJP48Y/VgQMwTk Po1A== X-Gm-Message-State: ALoCoQmdlafpy6ryXF8IgOfP+ZN71eTxf+tGr9BDhd1X3s9VULwXFXEjE3vSJCifK5jluItqaF9W X-Received: by 10.180.182.84 with SMTP id ec20mr5857581wic.42.1445011332809; Fri, 16 Oct 2015 09:02:12 -0700 (PDT) Received: from wychelm.lan (cpc4-aztw19-0-0-cust71.18-1.cable.virginm.net. [82.33.25.72]) by smtp.gmail.com with ESMTPSA id wz5sm4049192wjc.20.2015.10.16.09.02.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 09:02:11 -0700 (PDT) From: Daniel Thompson To: Herbert Xu , Matt Mackall Cc: Daniel Thompson , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Kukjin Kim , Krzysztof Kozlowski Subject: [PATCH] hwrng: exynos - Fix unbalanced PM runtime get/puts Date: Fri, 16 Oct 2015 17:01:51 +0100 Message-Id: <1445011311-32142-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Currently this driver calls pm_runtime_get_sync() rampantly but never puts anything back. This makes it impossible for the device to autosuspend properly; it will remain fully active after the first use. Fix in the obvious way. Signed-off-by: Daniel Thompson Cc: Kukjin Kim Cc: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski Reviewed-by: Krzysztof Kozlowski --- Notes: Compile tested only (CONFIG_PM=y, CONFIG_HW_RANDOM_EXYNOS=m); I spotted this whilst reviewing the code and don't have an exynos platform to test on. drivers/char/hw_random/exynos-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index dc4701fd814f..73318e2a34dd 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c @@ -95,7 +95,7 @@ static int exynos_read(struct hwrng *rng, void *buf, *data = exynos_rng_readl(exynos_rng, EXYNOS_PRNG_OUT1_OFFSET); pm_runtime_mark_last_busy(exynos_rng->dev); - pm_runtime_autosuspend(exynos_rng->dev); + pm_runtime_put_sync_autosuspend(exynos_rng->dev); return 4; }