[PATCH v5 05/16] media: mtk-jpeg: Use pm_runtime_resume_and_get for PM get_sync

Matthias Brugger matthias.bgg at gmail.com
Wed Jun 9 06:38:13 PDT 2021



On 10/04/2021 11:11, Yong Wu wrote:
> pm_runtime_get_sync will increment pm usage counter even it failed.
> This patch use pm_runtime_resume_and_get instead of pm_runtime_get
> to keep usage counter balanced.
> 
> CC: Xia Jiang <xia.jiang at mediatek.com>
> Signed-off-by: Yong Wu <yong.wu at mediatek.com>

Reviewed-by: Matthias Brugger <matthias.bgg at gmail.com>

> ---
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> index 88a23bce569d..a89c7b206eef 100644
> --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> @@ -920,7 +920,7 @@ static void mtk_jpeg_enc_device_run(void *priv)
>  	src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
>  	dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
>  
> -	ret = pm_runtime_get_sync(jpeg->dev);
> +	ret = pm_runtime_resume_and_get(jpeg->dev);
>  	if (ret < 0)
>  		goto enc_end;
>  
> @@ -973,7 +973,7 @@ static void mtk_jpeg_dec_device_run(void *priv)
>  		return;
>  	}
>  
> -	ret = pm_runtime_get_sync(jpeg->dev);
> +	ret = pm_runtime_resume_and_get(jpeg->dev);
>  	if (ret < 0)
>  		goto dec_end;
>  
> 



More information about the Linux-mediatek mailing list