mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiale Yao <yaojiale02@163.com>
To: 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
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH v2 0/4] media: wave5: fix runtime PM error handling
Date: Mon, 19 Oct 2026 16:20:22 +0800	[thread overview]
Message-ID: <20261019082026.1798945-1-yaojiale02@163.com> (raw)

The Wave5 decoder, encoder, and close paths assume that
pm_runtime_resume_and_get() always succeeds. Runtime resume can fail while
enabling the VPU clocks, after which firmware commands can access unavailable
registers and cleanup paths can drop references that were not acquired.

Check runtime resume results before hardware access. On errors from callbacks
that cannot return an error, return queued buffers and complete the active
job. When closing an instance, still release host-side resources and return
-EIO so the common release path completes instance cleanup.

media-next already checks the decoder destination queue resume result, but
uses vb2_buffer_done() instead of the mem2mem completion helper. This series
keeps the remaining decoder resume fixes separate from that interface fix.

Jiale Yao (4):
  media: wave5: handle remaining decoder runtime resume failures
  media: wave5: use m2m buffer completion helper
  media: wave5: handle encoder runtime resume failures
  media: wave5: handle runtime resume failure when closing

---
Changes in v2:
  - Rebase on media-next.
  - Split the decoder changes: fix the remaining unchecked resume results
    separately from the existing destination-buffer completion path.
  - Use v4l2_m2m_buf_done() for the destination-buffer completion path.
  - Stop the encoder and fail both queues on a runtime resume failure to
    prevent the mem2mem scheduler from repeatedly running a failed job.
  - Rebase the close-path cleanup on the already accepted runtime PM
    reference leak fix.
  - Drop v1 patch 4 because its runtime PM reference leak fix is already
    accepted upstream.

 .../chips-media/wave5/wave5-vpu-dec.c         | 49 ++++++++++++++++---
 .../chips-media/wave5/wave5-vpu-enc.c         | 33 +++++++++++--
 .../platform/chips-media/wave5/wave5-vpuapi.c | 18 ++++++-
 3 files changed, 89 insertions(+), 11 deletions(-)

-- 
2.34.1


             reply	other threads:[~2026-10-19  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  8:20 Jiale Yao [this message]
2026-10-19  8:20 ` [PATCH v2 1/4] media: wave5: handle remaining decoder runtime resume failures Jiale Yao
2026-10-19  8:20 ` [PATCH v2 2/4] media: wave5: use m2m buffer completion helper Jiale Yao
2026-10-19  8:20 ` [PATCH v2 3/4] media: wave5: handle encoder runtime resume failures Jiale Yao
2026-10-20  1:10   ` jackson.lee
2026-10-19  8:20 ` [PATCH v2 4/4] media: wave5: handle runtime resume failure when closing Jiale Yao
2026-10-20  1:26   ` jackson.lee
2026-10-21 15:20     ` jiale yao

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=20261019082026.1798945-1-yaojiale02@163.com \
    --to=yaojiale02@163.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 \
    /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®