media: mediatek: vcodec: Using pm_runtime_put instead of pm_runtime_put_sync
authorYunfei Dong <yunfei.dong@mediatek.com>
Sat, 14 Jan 2023 09:41:12 +0000 (10:41 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 06:32:54 +0000 (07:32 +0100)
pm_runtime_put will set RPM_ASYNC flag then queue an idle-notification
request again, won't return error immediately until current request is
scheduled.

But pm_runtime_put_sync run the ->runtime_idle() callback directly, return
error immediately no matter whether current request is scheduled.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_pm.c

index 4305e4eb9900d686589b3ac6f9d9b6638ac5bc75..777d445999e9b702516722ca5be4afcc29e3b9d9 100644 (file)
@@ -72,9 +72,9 @@ static void mtk_vcodec_dec_pw_off(struct mtk_vcodec_pm *pm)
 {
        int ret;
 
-       ret = pm_runtime_put_sync(pm->dev);
-       if (ret)
-               mtk_v4l2_err("pm_runtime_put_sync fail %d", ret);
+       ret = pm_runtime_put(pm->dev);
+       if (ret && ret != -EAGAIN)
+               mtk_v4l2_err("pm_runtime_put fail %d", ret);
 }
 
 static void mtk_vcodec_dec_clock_on(struct mtk_vcodec_pm *pm)