mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/4] media: wave5: fix runtime PM error handling
@ 2026-10-19  8:20 Jiale Yao
  2026-10-19  8:20 ` [PATCH v2 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-19  8:20 UTC (permalink / raw)
  To: Nas Chung, Jackson Lee, Mauro Carvalho Chehab, Nicolas Dufresne,
	Sebastian Fricke, Hans Verkuil, linux-media, linux-kernel
  Cc: Jiale Yao

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


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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19  8:20 [PATCH v2 0/4] media: wave5: fix runtime PM error handling Jiale Yao
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

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®