Skip to contentSkip to conversation

hwrng: exynos - Fix unbalanced PM runtime get/puts

PATCH In review Daniel Thompson 3 participants 3 messages Oct 16, 2015 – Oct 20, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

---

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(-)
drivers/char/hw_random/exynos-rng.c +1 -1
index dc4701fd814f..73318e2a34dd 100644
@@ -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

Tested-by Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Daniel Thompson

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.

Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

---

Quoted 7 lines

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

To test the patch I had to add OF support to the driver. I have these patches almost ready and I will send them soon. Anyway:

Tested on Trats2 board (Exynos4412):

Best regards,
Krzysztof

maintainer
#2 lore raw
In reply to Daniel Thompson
Quoted 10 lines · Daniel Thompson

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.

Cc Kukjin Kim <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt