From: Tharit Tangkijwanichakul <tharitt97@gmail.com>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
Hans Verkuil <hverkuil@kernel.org>,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org,
me@brighamcampbell.com, jkoolstra@xs4all.nl,
Frank.li@oss.nxp.com,
Tharit Tangkijwanichakul <tharitt97@gmail.com>
Subject: [PATCH v5 0/2] media: hantro: fix runtime PM resource handling
Date: Wed, 29 Jul 2026 06:04:38 +0000 [thread overview]
Message-ID: <20260729060440.2092-1-tharitt97@gmail.com> (raw)
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
next reply other threads:[~2026-07-29 6:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 6:04 Tharit Tangkijwanichakul [this message]
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
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=20260729060440.2092-1-tharitt97@gmail.com \
--to=tharitt97@gmail.com \
--cc=Frank.li@oss.nxp.com \
--cc=benjamin.gaignard@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=hverkuil@kernel.org \
--cc=jkoolstra@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=me@brighamcampbell.com \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=skhan@linuxfoundation.org \
/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