mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/4] media: wave5: fix runtime PM error handling
@ 2026-10-21 15:15 Jiale Yao
  2026-10-21 15:15 ` [PATCH v3 1/4] media: wave5: handle remaining decoder runtime resume failures Jiale Yao
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jiale Yao @ 2026-10-21 15:15 UTC (permalink / raw)
  To: Nas Chung, Jackson Lee, Mauro Carvalho Chehab, Nicolas Dufresne,
	Sebastian Fricke, Hans Verkuil, linux-media, linux-kernel

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.

Changes in v3:
- Move the encoder STOP state transition before runtime resume in
  stop_streaming(), so a resume failure cannot leave the instance in
  PIC_RUN.
- Factor decoder host-resource cleanup into a helper and return -EIO
  directly after resume failure, avoiding an unheld mutex unlock and an
  unmatched runtime PM put.
- Add Jackson Lee's Reviewed-by tag to the encoder patch.
- Keep the m2m buffer completion helper patch unchanged.

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.

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

 .../chips-media/wave5/wave5-vpu-dec.c         | 49 ++++++++++++++++---
 .../chips-media/wave5/wave5-vpu-enc.c         | 35 +++++++++++--
 .../platform/chips-media/wave5/wave5-vpuapi.c | 47 +++++++++++-------
 3 files changed, 103 insertions(+), 28 deletions(-)


base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
-- 
2.34.1


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

end of thread, other threads:[~2026-10-22 15:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21 15:15 [PATCH v3 0/4] media: wave5: fix runtime PM error handling Jiale Yao
2026-10-21 15:15 ` [PATCH v3 1/4] media: wave5: handle remaining decoder runtime resume failures Jiale Yao
2026-10-22 15:29   ` Brandon Brnich
2026-10-21 15:15 ` [PATCH v3 2/4] media: wave5: use m2m buffer completion helper Jiale Yao
2026-10-22 15:51   ` Brandon Brnich
2026-10-21 15:15 ` [PATCH v3 3/4] media: wave5: handle encoder runtime resume failures Jiale Yao
2026-10-21 15:15 ` [PATCH v3 4/4] media: wave5: handle runtime resume failure when closing Jiale Yao
2026-10-22  0:51   ` jackson.lee

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®