From 9cfc1aca0781ce08e307b6c9dd617d37021544a8 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 23 Sep 2026 23:10:33 +0200 Subject: [PATCH] media: mali-c55: Ignore disconnected queues when checking readiness mali_c55_pipeline_ready() waits for every video queue to enter its start_streaming callback, regardless of whether its media link is enabled. When libcamera uses the TPG, it disables the statistics and parameters links and queues only image buffers. Although STREAMON succeeds on the metadata nodes, videobuf2 never invokes their callbacks without queued buffers. The ISP and TPG are therefore never enabled and capture hangs. An unused full-resolution or downscaled output can similarly prevent the pipeline from starting. Only require queues connected through enabled media links to have started. Use media_pad_remote_pad_first() to check the video node pads, retaining the capability check before accessing the optional downscale device. The shared readiness check also keeps stream-off consistent: the first active queue to stop disables the ISP. Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Linus Walleij Reviewed-by: Jacopo Mondi Signed-off-by: Jacopo Mondi Signed-off-by: Hans Verkuil --- drivers/media/platform/arm/mali-c55/mali-c55-core.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/media/platform/arm/mali-c55/mali-c55-core.c index 5a061ec5ec5c..241a625f7284 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c @@ -510,11 +510,16 @@ bool mali_c55_pipeline_ready(struct mali_c55 *mali_c55) struct mali_c55_params *params = &mali_c55->params; struct mali_c55_stats *stats = &mali_c55->stats; - return vb2_start_streaming_called(&fr->queue) && + /* Only wait for queues connected through enabled media links. */ + return (!media_pad_remote_pad_first(&fr->pad) || + vb2_start_streaming_called(&fr->queue)) && (!(mali_c55->capabilities & MALI_C55_GPS_DS_PIPE_FITTED) || + !media_pad_remote_pad_first(&ds->pad) || vb2_start_streaming_called(&ds->queue)) && - vb2_start_streaming_called(¶ms->queue) && - vb2_start_streaming_called(&stats->queue); + (!media_pad_remote_pad_first(¶ms->pad) || + vb2_start_streaming_called(¶ms->queue)) && + (!media_pad_remote_pad_first(&stats->pad) || + vb2_start_streaming_called(&stats->queue)); } static int mali_c55_check_hwcfg(struct mali_c55 *mali_c55)