Skip to contentSkip to conversation

hwrng: omap: disable runtime PM on resume failure

PATCH In review Myeonghun Pak 1 participant 2 messages Jun 26

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

PATCH 1/1 hwrng: omap: disable runtime PM on resume failure

omap_rng_probe() enables runtime PM before calling pm_runtime_resume_and_get(). If the resume call fails, the error path currently jumps to err_ioremap and returns without disabling runtime PM again.

Add a runtime-PM-only error label and route the resume failure through it. The label is placed after the runtime PM usage-count unwind, so later probe failures keep using the existing pm_runtime_put_sync() path while this early failure only disables the runtime PM state that was already enabled.

Fixes 61dc0a446e5d ("hwrng: omap - Fix assumption that runtime_get_sync will always succeed")
---
 drivers/char/hw_random/omap-rng.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/hw_random/omap-rng.c +2 -1
index 5e8b50f15dc3..44b8bb4a24a8 100644
@@ -455,7 +455,7 @@ static int omap_rng_probe(struct platform_device *pdev)
 	ret = pm_runtime_resume_and_get(&pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret);
-		goto err_ioremap;
+		goto err_pm_disable;
 	}
 
 	priv->clk = devm_clk_get(&pdev->dev, NULL);
@@ -499,6 +499,7 @@ err_register:
 err_register:
 	priv->base = NULL;
 	pm_runtime_put_sync(&pdev->dev);
+err_pm_disable:
 	pm_runtime_disable(&pdev->dev);
 
 	clk_disable_unprepare(priv->clk_reg);
Signature · 1 line
2.47.1
#1 lore raw

Please ignore this patch.

I noticed after sending it that this patch was not properly checked against the existing omap-rng probe error-path cleanup discussion, and it should not be reviewed as-is.

Sorry for the noise.

Thanks,
Myeonghun

2026년 6월 26일 (금) 오후 6:03, Myeonghun Pak <[email protected]>님이 작성:

Quoted 43 lines

omap_rng_probe() enables runtime PM before calling pm_runtime_resume_and_get(). If the resume call fails, the error path currently jumps to err_ioremap and returns without disabling runtime PM again.

Add a runtime-PM-only error label and route the resume failure through it. The label is placed after the runtime PM usage-count unwind, so later probe failures keep using the existing pm_runtime_put_sync() path while this early failure only disables the runtime PM state that was already enabled.

Fixes 61dc0a446e5d ("hwrng: omap - Fix assumption that runtime_get_sync will always succeed")
---
 drivers/char/hw_random/omap-rng.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/hw_random/omap-rng.c +2 -2
index 5e8b50f15dc3..44b8bb4a24a8 100644
@@ -455,7 +455,7 @@ static int omap_rng_probe(struct platform_device *pdev)
        ret = pm_runtime_resume_and_get(&pdev->dev);
        if (ret < 0) {
                dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret);
-               goto err_ioremap;
+               goto err_pm_disable;
        }
 
        priv->clk = devm_clk_get(&pdev->dev, NULL);
@@ -499,6 +499,7 @@ err_register:
 err_register:
        priv->base = NULL;
        pm_runtime_put_sync(&pdev->dev);
+err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 
        clk_disable_unprepare(priv->clk_reg);
--

2.47.1