All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwrng: exynos - Fix unbalanced PM runtime get/puts
@ 2015-10-16 16:01 ` Daniel Thompson
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Thompson @ 2015-10-16 16:01 UTC (permalink / raw)
  To: Herbert Xu, Matt Mackall
  Cc: Daniel Thompson, linux-crypto, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, patches, linaro-kernel,
	Kukjin Kim, Krzysztof Kozlowski

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 <daniel.thompson@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---

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(-)

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;
 }
--
2.4.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-20 14:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 16:01 [PATCH] hwrng: exynos - Fix unbalanced PM runtime get/puts Daniel Thompson
2015-10-16 16:01 ` Daniel Thompson
2015-10-19  1:41 ` Krzysztof Kozlowski
2015-10-19  1:41   ` Krzysztof Kozlowski
2015-10-20 14:19 ` Herbert Xu
2015-10-20 14:19   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.