Skip to contentSkip to conversation

Patch "hwrng: exynos - Disable runtime PM on probe failure" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Sep 12, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

hwrng: exynos - Disable runtime PM on probe failure

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
hwrng-exynos-disable-runtime-pm-on-probe-failure.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 48a61e1e2af8020f11a2b8f8dc878144477623c6 Mon Sep 17 00:00:00 2001

From: Krzysztof Kozlowski <[email protected]>
Date: Mon, 14 Mar 2016 09:07:14 +0900
Subject: hwrng: exynos - Disable runtime PM on probe failure

From: Krzysztof Kozlowski <[email protected]>

commit 48a61e1e2af8020f11a2b8f8dc878144477623c6 upstream.

Add proper error path (for disabling runtime PM) when registering of hwrng fails.

Fixes b329669ea0b5 ("hwrng: exynos - Add support for Exynos random number generator")
---
 drivers/char/hw_random/exynos-rng.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/char/hw_random/exynos-rng.c +8 -1
@@ -118,6 +118,7 @@ static int exynos_rng_probe(struct platf
 {
 	struct exynos_rng *exynos_rng;
 	struct resource *res;
+	int ret;
 
 	exynos_rng = devm_kzalloc(&pdev->dev, sizeof(struct exynos_rng),
 					GFP_KERNEL);
@@ -145,7 +146,13 @@ static int exynos_rng_probe(struct platf
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
-	return devm_hwrng_register(&pdev->dev, &exynos_rng->rng);
+	ret = devm_hwrng_register(&pdev->dev, &exynos_rng->rng);
+	if (ret) {
+		pm_runtime_dont_use_autosuspend(&pdev->dev);
+		pm_runtime_disable(&pdev->dev);
+	}
+
+	return ret;
 }
 
 #ifdef CONFIG_PM

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/hwrng-exynos-disable-runtime-pm-on-probe-failure.patch