From: Daniel Thompson Date: Fri, 16 Oct 2015 16:01:51 +0000 (+0100) Subject: hwrng: exynos - Fix unbalanced PM runtime get/puts X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f02b7d0c7b433b9a8175ac9027391272877a43ce;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git hwrng: exynos - Fix unbalanced PM runtime get/puts 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 Signed-off-by: Herbert Xu --- 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; }