The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v5 0/2] media: hantro: fix runtime PM resource handling
@ 2026-07-29  6:04 Tharit Tangkijwanichakul
  2026-07-29  6:04 ` [PATCH v5 1/2] media: hantro: release runtime resources when device_run fails Tharit Tangkijwanichakul
  2026-07-29  6:04 ` [PATCH v5 2/2] media: hantro: use DEFINE_RUNTIME_DEV_PM_OPS Tharit Tangkijwanichakul
  0 siblings, 2 replies; 3+ messages in thread
From: Tharit Tangkijwanichakul @ 2026-07-29  6:04 UTC (permalink / raw)
  To: Nicolas Dufresne, Benjamin Gaignard, Philipp Zabel,
	Mauro Carvalho Chehab
  Cc: Ezequiel Garcia, Hans Verkuil, linux-media, linux-rockchip,
	linux-kernel, linux-arm-kernel, linux-kernel-mentees, skhan, me,
	jkoolstra, Frank.li, Tharit Tangkijwanichakul

The Hantro device_run() path acquires a runtime PM reference before
invoking the codec-specific run callback. Failure paths can leave the
runtime PM reference and enabled clocks held.

Patch 1 moves clock enable and disable operations into the runtime PM
callbacks and releases the runtime PM reference when device_run()
fails. It retains the existing CONFIG_PM conditional so that the patch
remains independently buildable.

Patch 2 removes the explicit CONFIG_PM conditional, defines the PM
operations with DEFINE_RUNTIME_DEV_PM_OPS(), and uses pm_ptr() when
assigning the PM operations to the platform driver.

Changes in v5:
- Split the runtime PM changes into two patches.
- Move clock management into the runtime PM callbacks.
- Release the runtime PM reference on device_run() failure.
- Retain the CONFIG_PM conditional in patch 1.
- Remove the CONFIG_PM conditional in patch 2 using
  DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr().

v4:
https://lore.kernel.org/linux-media/20260728045921.4761-1-tharitt97@gmail.com

Tharit Tangkijwanichakul (2):
  media: hantro: release runtime resources when device_run fails
  media: hantro: use DEFINE_RUNTIME_DEV_PM_OPS

 .../media/platform/verisilicon/hantro_drv.c   | 75 ++++++++++---------
 1 file changed, 41 insertions(+), 34 deletions(-)
---
Tested on a Rockchip RK3588 (Rock 5B) board with Fluster:
  H.264 (JVT-AVC_V1):	     129/135, unchanged
  MPEG-2 (MPEG2_VIDEO-MAIN): 23/43, unchanged
  VP8 (VP8-TEST-VECTORS):    61/61, unchanged

base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
-- 
2.47.3


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

end of thread, other threads:[~2026-07-29  6:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29  6:04 [PATCH v5 0/2] media: hantro: fix runtime PM resource handling Tharit Tangkijwanichakul
2026-07-29  6:04 ` [PATCH v5 1/2] media: hantro: release runtime resources when device_run fails Tharit Tangkijwanichakul
2026-07-29  6:04 ` [PATCH v5 2/2] media: hantro: use DEFINE_RUNTIME_DEV_PM_OPS Tharit Tangkijwanichakul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox