Commit bbe516e9 authored by Dinghao Liu's avatar Dinghao Liu Committed by Mauro Carvalho Chehab

media: venus: core: Fix runtime PM imbalance in venus_probe

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced. For other error
paths after this call, things are the same.

Fix this by adding pm_runtime_put_noidle() after 'err_runtime_disable'
label. But in this case, the error path after pm_runtime_put_sync()
will decrease PM usage counter twice. Thus add an extra
pm_runtime_get_noresume() in this path to balance PM counter.
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 5cef0785
...@@ -287,8 +287,10 @@ static int venus_probe(struct platform_device *pdev) ...@@ -287,8 +287,10 @@ static int venus_probe(struct platform_device *pdev)
goto err_core_deinit; goto err_core_deinit;
ret = pm_runtime_put_sync(dev); ret = pm_runtime_put_sync(dev);
if (ret) if (ret) {
pm_runtime_get_noresume(dev);
goto err_dev_unregister; goto err_dev_unregister;
}
return 0; return 0;
...@@ -299,6 +301,7 @@ static int venus_probe(struct platform_device *pdev) ...@@ -299,6 +301,7 @@ static int venus_probe(struct platform_device *pdev)
err_venus_shutdown: err_venus_shutdown:
venus_shutdown(core); venus_shutdown(core);
err_runtime_disable: err_runtime_disable:
pm_runtime_put_noidle(dev);
pm_runtime_set_suspended(dev); pm_runtime_set_suspended(dev);
pm_runtime_disable(dev); pm_runtime_disable(dev);
hfi_destroy(core); hfi_destroy(core);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment