mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brandon Brnich <b-brnich@ti.com>
To: Jiale Yao <yaojiale02@163.com>,
	Nas Chung <nas.chung@chipsnmedia.com>,
	Jackson Lee <jackson.lee@chipsnmedia.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Sebastian Fricke <sebastian.fricke@collabora.com>,
	Hans Verkuil <hverkuil@kernel.org>, <linux-media@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] media: wave5: release runtime PM reference on encoder close errors
Date: Wed, 7 Oct 2026 11:15:21 -0500	[thread overview]
Message-ID: <ebfa9a8b-89f5-445c-8d17-12ee8a830a07@ti.com> (raw)
In-Reply-To: <20261003080853.430099-5-yaojiale02@163.com>

Hi Jiale,

Thanks for the patch.

On 10/3/26 03:08, Jiale Yao wrote:
> wave5_vpu_enc_close() acquires a runtime PM reference before taking the
> hardware lock, but three error paths call pm_runtime_resume_and_get()
> again instead of releasing that reference. Each failure therefore
> increments the usage count and can prevent the VPU from suspending.
> 
> Use pm_runtime_put_sync() on the error paths, matching the successful
> path and the decoder close implementation.
These issues have already been addressed and are accepted[0].

Best,
Brandon

[0]: 
https://patchwork.linuxtv.org/project/linux-media/patch/20260717075714.1508938-1-lilinmao@kylinos.cn/

> 
> Fixes: 2092b3833487 ("media: chips-media: wave5: Support runtime suspend/resume")
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> ---
>   drivers/media/platform/chips-media/wave5/wave5-vpuapi.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> index 42bc737c6980..062f0b5c318b 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> @@ -758,7 +758,7 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
>   
>   	ret = mutex_lock_interruptible(&vpu_dev->hw_lock);
>   	if (ret) {
> -		pm_runtime_resume_and_get(inst->dev->dev);
> +		pm_runtime_put_sync(inst->dev->dev);
>   		return ret;
>   	}
>   
> @@ -766,14 +766,14 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
>   		ret = wave5_vpu_enc_finish_seq(inst, fail_res);
>   		if (ret < 0 && *fail_res != WAVE5_SYSERR_VPU_STILL_RUNNING) {
>   			dev_warn(inst->dev->dev, "enc_finish_seq timed out\n");
> -			pm_runtime_resume_and_get(inst->dev->dev);
> +			pm_runtime_put_sync(inst->dev->dev);
>   			mutex_unlock(&vpu_dev->hw_lock);
>   			return ret;
>   		}
>   
>   		if (*fail_res == WAVE5_SYSERR_VPU_STILL_RUNNING &&
>   		    retry++ >= MAX_FIRMWARE_CALL_RETRY) {
> -			pm_runtime_resume_and_get(inst->dev->dev);
> +			pm_runtime_put_sync(inst->dev->dev);
>   			mutex_unlock(&vpu_dev->hw_lock);
>   			return -ETIMEDOUT;
>   		}


      reply	other threads:[~2026-10-07 16:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03  8:08 [PATCH 0/4] media: wave5: fix runtime PM error handling Jiale Yao
2026-10-03  8:08 ` [PATCH 1/4] media: wave5: handle decoder runtime resume failures Jiale Yao
2026-10-07 16:24   ` Brandon Brnich
2026-10-03  8:08 ` [PATCH 2/4] media: wave5: handle encoder " Jiale Yao
2026-10-08  7:16   ` jackson.lee
2026-10-03  8:08 ` [PATCH 3/4] media: wave5: handle runtime resume failure when closing Jiale Yao
2026-10-08  7:35   ` jackson.lee
2026-10-03  8:08 ` [PATCH 4/4] media: wave5: release runtime PM reference on encoder close errors Jiale Yao
2026-10-07 16:15   ` Brandon Brnich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebfa9a8b-89f5-445c-8d17-12ee8a830a07@ti.com \
    --to=b-brnich@ti.com \
    --cc=hverkuil@kernel.org \
    --cc=jackson.lee@chipsnmedia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nas.chung@chipsnmedia.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=sebastian.fricke@collabora.com \
    --cc=yaojiale02@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®