From: Jiale Yao <yaojiale02@163.com>
To: 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
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 2/2] media: amphion: handle debug runtime resume failure
Date: Mon, 19 Oct 2026 16:27:54 +0800 [thread overview]
Message-ID: <20261019082754.1806443-3-yaojiale02@163.com> (raw)
In-Reply-To: <20261019082754.1806443-1-yaojiale02@163.com>
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>
---
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");
--
2.34.1
next prev parent reply other threads:[~2026-10-19 8:28 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 ` Jiale Yao [this message]
2026-10-19 8:31 ` Re:[PATCH 2/2] media: amphion: handle debug runtime resume failure jiale yao
2026-10-19 9:58 ` [PATCH " Ming Qian(OSS)
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=20261019082754.1806443-3-yaojiale02@163.com \
--to=yaojiale02@163.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 \
/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®