hwrng: omap: disable runtime PM on resume failure
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.
--- drivers/char/hw_random/omap-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/hw_random/omap-rng.c +2 -1
@@ -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
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 callingpm_runtime_resume_and_get(). If the resume call fails, the error path currently jumps toerr_ioremapand 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")Co-developed-by Ijae Kim <[email protected]>Signed-off-by Ijae Kim <[email protected]>Signed-off-by Myeonghun Pak <[email protected]>--- drivers/char/hw_random/omap-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/char/hw_random/omap-rng.c +2
-2@@ -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