diff options
author | Shang XiaoJing <shangxiaojing@huawei.com> | 2022-11-24 09:51:13 +0800 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-11-28 11:58:19 +0100 |
commit | 0ae41323a83233610e64e926eefb4d132ecb9028 (patch) | |
tree | 500759a93192ce341cf7acd4eabbd0916bbabd03 /drivers/gpu/drm/vc4/vc4_vec.c | |
parent | 9a49bf098752b30e92e59da03db7eca49ace61c7 (diff) | |
download | linux-0ae41323a83233610e64e926eefb4d132ecb9028.tar.gz linux-0ae41323a83233610e64e926eefb4d132ecb9028.tar.bz2 linux-0ae41323a83233610e64e926eefb4d132ecb9028.zip |
drm/vc4: vec: Use pm_runtime_resume_and_get() in vc4_vec_encoder_enable()
Commit f0601ef8631c ("drm/vc4: vec: Protect device resources after
removal") add fail path for vc4_vec_encoder_enable(), and will put
usage_counter only when pm_runtime_get_sync() succeeds. However,
pm_runtime_get_sync() will increment usage_counter even it failed. Fix
it by replacing it with pm_runtime_resume_and_get() to keep usage
counter balanced.
Fixes: e4b81f8c74c8 ("drm/vc4: Add support for the VEC (Video Encoder) IP")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20221124015113.18540-1-shangxiaojing@huawei.com
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_vec.c')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_vec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c index d23dbad3cbf6..e270a4099be3 100644 --- a/drivers/gpu/drm/vc4/vc4_vec.c +++ b/drivers/gpu/drm/vc4/vc4_vec.c @@ -558,7 +558,7 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder, if (!tv_mode) goto err_dev_exit; - ret = pm_runtime_get_sync(&vec->pdev->dev); + ret = pm_runtime_resume_and_get(&vec->pdev->dev); if (ret < 0) { DRM_ERROR("Failed to retain power domain: %d\n", ret); goto err_dev_exit; |