linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open
@ 2020-05-22 11:13 Dinghao Liu
  2020-06-23  9:45 ` Stanimir Varbanov
  0 siblings, 1 reply; 3+ messages in thread
From: Dinghao Liu @ 2020-05-22 11:13 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Stanimir Varbanov, Andy Gross, Bjorn Andersson,
	Mauro Carvalho Chehab, linux-media, linux-arm-msm, linux-kernel

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.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/media/platform/qcom/venus/vdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ed2628585a1..6f2964130728 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1349,7 +1349,7 @@ static int vdec_open(struct file *file)
 
 	ret = pm_runtime_get_sync(core->dev_dec);
 	if (ret < 0)
-		goto err_free_inst;
+		goto err_put_sync;
 
 	ret = vdec_ctrl_init(inst);
 	if (ret)
@@ -1394,7 +1394,6 @@ static int vdec_open(struct file *file)
 	vdec_ctrl_deinit(inst);
 err_put_sync:
 	pm_runtime_put_sync(core->dev_dec);
-err_free_inst:
 	kfree(inst);
 	return ret;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open
  2020-05-22 11:13 [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open Dinghao Liu
@ 2020-06-23  9:45 ` Stanimir Varbanov
  2020-06-24  6:14   ` dinghao.liu
  0 siblings, 1 reply; 3+ messages in thread
From: Stanimir Varbanov @ 2020-06-23  9:45 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Stanimir Varbanov, Andy Gross, Bjorn Andersson,
	Mauro Carvalho Chehab, linux-media, linux-arm-msm, linux-kernel

Hi Dinghao,

This patch is not applicable anymore after [1].

[1] 63342afea65e ("media: venus: vdec: Use pmruntime autosuspend")

On 5/22/20 2:13 PM, Dinghao Liu wrote:
> 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.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/media/platform/qcom/venus/vdec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 4ed2628585a1..6f2964130728 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -1349,7 +1349,7 @@ static int vdec_open(struct file *file)
>  
>  	ret = pm_runtime_get_sync(core->dev_dec);
>  	if (ret < 0)
> -		goto err_free_inst;
> +		goto err_put_sync;
>  
>  	ret = vdec_ctrl_init(inst);
>  	if (ret)
> @@ -1394,7 +1394,6 @@ static int vdec_open(struct file *file)
>  	vdec_ctrl_deinit(inst);
>  err_put_sync:
>  	pm_runtime_put_sync(core->dev_dec);
> -err_free_inst:
>  	kfree(inst);
>  	return ret;
>  }
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open
  2020-06-23  9:45 ` Stanimir Varbanov
@ 2020-06-24  6:14   ` dinghao.liu
  0 siblings, 0 replies; 3+ messages in thread
From: dinghao.liu @ 2020-06-24  6:14 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: kjlu, Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

Hi Stanimir,

> 
> This patch is not applicable anymore after [1].
> 
> [1] 63342afea65e ("media: venus: vdec: Use pmruntime autosuspend")
> 

Since pm_runtime_get_sync() has been removed from vdec_open(), 
this patch is no longer needed.

Regards,
Dinghao

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-24  6:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 11:13 [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open Dinghao Liu
2020-06-23  9:45 ` Stanimir Varbanov
2020-06-24  6:14   ` dinghao.liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).