Skip to content

media: hantro: fix runtime PM resource handling

Tharit Tangkijwanichakul linux-arm-kernel linux-kernel-mentees linux-media linux-rockchip lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 2 repliesIn review
  2. v41 patch 0 repliesSuperseded
  3. v31 patch 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch0 repliesSuperseded
v11 patch4 repliesSuperseded

Changes in v5 from the cover letter

- 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().

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2media: hantro: release runtime resources when device_run failsdrivers/media/platform/verisilicon/hantro_drv.c+39 -271 reply
2/2media: hantro: use DEFINE_RUNTIME_DEV_PM_OPSdrivers/media/platform/verisilicon/hantro_drv.c+3 -81 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFrank Li
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/2] media: hantro: fix runtime PM resource handling

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/[email protected]

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

Signature · 1 line
2.47.3