7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit 9cfc1aca0781ce08e307b6c9dd617d37021544a8 ] 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 Signed-off-by: Sasha Levin --- 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 288fba4831808..a14c6042345bf 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) -- 2.53.0