Re: [PATCH 1/2] media: c3-mipi-adap: handle runtime resume failure
From: Keke Li
Date: Mon Oct 19 2026 - 02:24:02 EST
Hi Jiale,
Thanks for your patch.
On 10/3/26 16:11, Jiale Yao wrote:
[You don't often get email from yaojiale02@xxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
[ EXTERNAL EMAIL ]
c3_mipi_adap_enable_streams() ignores runtime resume failures and
continues programming adapter registers before reporting that streaming
started. If the power domain could not be resumed, those register
accesses are unsafe and the disable path later drops a reference that
was not acquired.
Return the runtime PM error before accessing the adapter.
Fixes: f0d2d8062cc8 ("media: platform: Add C3 MIPI adapter driver")
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c b/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c
index 4bd98fb9c7e9..750b301f4bbf 100644
--- a/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c
+++ b/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c
@@ -455,7 +455,9 @@ static int c3_mipi_adap_enable_streams(struct v4l2_subdev *sd,
src_sd = media_entity_to_v4l2_subdev(adap->src_pad->entity);
- pm_runtime_resume_and_get(adap->dev);
+ ret = pm_runtime_resume_and_get(adap->dev);
+ if (ret < 0)
Is ' if (ret)' better?
Thanks!
+ return ret;
fmt = v4l2_subdev_state_get_format(state, C3_MIPI_ADAP_PAD_SINK);
--
2.34.1