mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ming Qian(OSS)" <ming.qian@oss.nxp.com>
To: Jiale Yao <yaojiale02@163.com>, Ming Qian <ming.qian@nxp.com>,
	Zhou Peng <eagle.zhou@nxp.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] media: amphion: handle debug runtime resume failure
Date: Mon, 19 Oct 2026 17:58:16 +0800	[thread overview]
Message-ID: <2d415b87-b14d-402e-b69c-153431f7a600@oss.nxp.com> (raw)
In-Reply-To: <20261019082754.1806443-3-yaojiale02@163.com>



On 10/19/2026 4:27 PM, Jiale Yao wrote:
> The debugfs core write handler reads the VPU power state after
> pm_runtime_resume_and_get() fails. The device may be unavailable after
> a failed runtime resume, and the final runtime PM put does not match an
> acquired reference.
> 
> Return the resume error before taking the core lock or accessing VPU
> hardware.
> 
> Signed-off-by: Jiale Yao <yaojiale02@163.com>

Reviewed-by: Ming Qian <ming.qian@oss.nxp.com>

> ---
>   drivers/media/platform/amphion/vpu_dbg.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c
> index 497ae4e8a2..fff4df4f45 100644
> --- a/drivers/media/platform/amphion/vpu_dbg.c
> +++ b/drivers/media/platform/amphion/vpu_dbg.c
> @@ -382,8 +382,12 @@ static ssize_t vpu_dbg_core_write(struct file *file,
>   {
>   	struct seq_file *s = file->private_data;
>   	struct vpu_core *core = s->private;
> +	int ret;
> +
> +	ret = pm_runtime_resume_and_get(core->dev);
> +	if (ret < 0)
> +		return ret;
>   
> -	pm_runtime_resume_and_get(core->dev);
>   	mutex_lock(&core->lock);
>   	if (vpu_iface_get_power_state(core) && !core->request_count) {
>   		dev_info(core->dev, "reset\n");


      parent reply	other threads:[~2026-10-19  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  8:27 [PATCH 0/2] media: amphion: handle runtime resume failures Jiale Yao
2026-10-19  8:27 ` [PATCH 1/2] media: amphion: handle core " Jiale Yao
2026-10-19  8:31   ` jiale yao
2026-10-19  9:54   ` [PATCH " Ming Qian(OSS)
2026-10-19  8:27 ` [PATCH 2/2] media: amphion: handle debug runtime resume failure Jiale Yao
2026-10-19  8:31   ` jiale yao
2026-10-19  9:58   ` Ming Qian(OSS) [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=2d415b87-b14d-402e-b69c-153431f7a600@oss.nxp.com \
    --to=ming.qian@oss.nxp.com \
    --cc=eagle.zhou@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ming.qian@nxp.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®