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: 55124 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id D2FFF22FFA for ; Fri, 16 Oct 2015 16:02:14 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf4185083wic.3 for ; Fri, 16 Oct 2015 09:02:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=B+LwHx2I48zREshDrzldo/rVWuY2ah/Lv4fOxnLaGdA=; b=Fv3r75dO4TK2BL65zcR1MFE1cCA5ME/oM4A8fje1BUYJB1UaXWJ+OHdro6OJkRg+vH CbIJ0oKLz4FwvLOvgcOxsWNgCC87xZK7pJfl6RayX4SU0MizVJlbC1t0ZC+f0XGqlfyz s7hkK5814XBDhJERR6vG0WGHF7oBiSsEPvl3BmO0oN2dwi+dBcAVyyWo4hBCglsekaev QL0ybX+I2k141P5/O2cgWU8mtc6GDQjORgQfOH8pFt/YtFsTSU837dfZuQo0ZXNzdF79 1kHulPeX/j4pSMZqVzVthY1C7824bMU6UNwkZP25pGbW9VaSsMIABKhmO/K7KYPg3uF7 iGrA== X-Gm-Message-State: ALoCoQle10p8QoN6GOESDa2kQq8pxX3qb+UBE37RoB99TY1ZmHMvAnBDV1dN3FMDddsr06JRr2oX X-Received: by 10.112.54.197 with SMTP id l5mr3778482lbp.21.1445011334070; Fri, 16 Oct 2015 09:02:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.25.67 with SMTP id 64ls341635lfz.41.gmail; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) X-Received: by 10.25.152.211 with SMTP id a202mr5793389lfe.66.1445011333936; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id ta8si13316428lbb.115.2015.10.16.09.02.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 09:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lffv3 with SMTP id v3so82226982lff.0 for ; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) X-Received: by 10.25.86.213 with SMTP id k204mr5675451lfb.36.1445011333701; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.59.35 with SMTP id w3csp3888lbq; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) X-Received: by 10.194.205.162 with SMTP id lh2mr17611037wjc.61.1445011333038; Fri, 16 Oct 2015 09:02:13 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com. [209.85.212.170]) by mx.google.com with ESMTPS id ia5si24711664wjb.61.2015.10.16.09.02.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 09:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.170 as permitted sender) client-ip=209.85.212.170; Received: by wicll6 with SMTP id ll6so16755732wic.0 for ; Fri, 16 Oct 2015 09:02:12 -0700 (PDT) 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 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; }