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: 7418211 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 0CF87BEEA4 for ; Fri, 16 Oct 2015 16:02:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31E17208E1 for ; Fri, 16 Oct 2015 16:02:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 586A420905 for ; Fri, 16 Oct 2015 16:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932847AbbJPQCP (ORCPT ); Fri, 16 Oct 2015 12:02:15 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:35983 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932305AbbJPQCN (ORCPT ); Fri, 16 Oct 2015 12:02:13 -0400 Received: by wicgb1 with SMTP id gb1so15284609wic.1 for ; Fri, 16 Oct 2015 09:02:12 -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=WE641SO45DXEs8LtGxG1/JJbFAOhCl5Zead1BVikr3TFWgxamU13Gq2GE8UpJ0TwdS ISBvH+FHk8zut6hZIwNV8ri3fP1ODCGIfdzeESoxBtkZKTM/PuAXkgxfkvrAlD/4WmYc rv01XZLJ4S4vs6RoneumNvkJfEayZ/IKeup8J8TcIpGG3QlSdwoEK12NNKXi8ZeWma5X Wn2gAl+z630ikjBYTIhV8CNU23tKDN1jLMMBgGFi2b8PPbMSN/+BxTFPe2QMnqc+QZMa hLf2pLoGdFBJdCn3JhTTMzfSDS7z2mgqea9SeGdVpRLe9Tz6hBTuJGCFgsecfum4sWp6 DKTg== X-Gm-Message-State: ALoCoQmFEFph+xo7jHzgTajpaKfwm9gWPY/pbFd3Br4MkgnxejqpRnahUXkbI96VQe2GpGj267KV 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-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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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-crypto" 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; }