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: 7418331 Return-Path: X-Original-To: patchwork-linux-arm@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 A88B3BEEA4 for ; Fri, 16 Oct 2015 16:04:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D90A520905 for ; Fri, 16 Oct 2015 16:04:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F266520903 for ; Fri, 16 Oct 2015 16:04:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zn7Sn-00087w-Uw; Fri, 16 Oct 2015 16:02:37 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zn7Sl-0007kY-0y for linux-arm-kernel@lists.infradead.org; Fri, 16 Oct 2015 16:02:35 +0000 Received: by wijq8 with SMTP id q8so17813107wij.0 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=JVJnrgnNDO0s6i7xo8UlQksaTazTyWhYfxl6C8sW49X8EQ7f9fn6MkkTDBzZod0FKY GREcPlnuU4LxytBNSmpKLA89LSCIlCeVSJeilzCetm3V4a34kEsIZTAuQvC0oXN/jqfU vsls5YkLgsHIshwmlEf8LZMphAU57xKmHaeStj0WM6bhYKU20JbBqCKaofToCcm6GOZO T2d3O2B2AsmMZEQcE6LLCcAN2tMEZuGbuQcE55TCyigP2e2NvhUkvqTAeZ9Rq+jE/sQF rGaYw/Qd/j/MxeWLh4qzcr6dE4hz8fAIg18ZZNKZWU56Xb6Yh5+gxcWE1M40xQS8rxHs 8Zqw== X-Gm-Message-State: ALoCoQkbhmQoPrh1LN0AAuKSRSvB8TLJOxCRUVZNF0qN2b/vFWypHZfiR/PZz5MNhDoflRKc029f 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151016_090235_231162_E3BB1A4F X-CRM114-Status: GOOD ( 12.39 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Thompson , linux-samsung-soc@vger.kernel.org, Kukjin Kim , patches@linaro.org, Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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; }