Skip to contentSkip to conversation

media: mali-c55: Require an enabled link to start a video node

PATCH Superseded David Carlier 1 participant 1 message Nov 5

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: mali-c55: Require an enabled link to start a video node

mali_c55_pipeline_ready() skips queues whose link is disabled, but such a queue can still start streaming on its own, as the video node pads lack MEDIA_PAD_FL_MUST_CONNECT. Stopping it later sees a ready pipeline and disables the ISP under the connected queues still capturing.

Mark the video node pads MUST_CONNECT so that starting a disconnected node fails with -ENOLINK.

Fixes d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")

---
Build tested only (W=1, checkpatch --strict clean). Not tested on hardware, and no reproducer was run; the STREAMON/STREAMOFF sequence on a disconnected stats node is from code reading.

 drivers/media/platform/arm/mali-c55/mali-c55-capture.c | 2 +-
 drivers/media/platform/arm/mali-c55/mali-c55-params.c  | 2 +-
 drivers/media/platform/arm/mali-c55/mali-c55-stats.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +1 -1
index ff01553026fb..2dbce550d089 100644
@@ -855,7 +855,7 @@ static int mali_c55_register_cap_dev(struct mali_c55 *mali_c55,
 		goto err_destroy_mutex;
 	}
 
-	cap_dev->pad.flags = MEDIA_PAD_FL_SINK;
+	cap_dev->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT;
 	ret = media_entity_pads_init(&cap_dev->vdev.entity, 1, &cap_dev->pad);
 	if (ret)
 		goto err_destroy_mutex;
drivers/media/platform/arm/mali-c55/mali-c55-params.c +1 -1
index 16e895e3488e..0888dc4a340e 100644
@@ -1014,7 +1014,7 @@ int mali_c55_register_params(struct mali_c55 *mali_c55)
 	INIT_LIST_HEAD(&params->buffers.queue);
 	spin_lock_init(&params->buffers.lock);
 
-	params->pad.flags = MEDIA_PAD_FL_SOURCE;
+	params->pad.flags = MEDIA_PAD_FL_SOURCE | MEDIA_PAD_FL_MUST_CONNECT;
 	ret = media_entity_pads_init(&params->vdev.entity, 1, &params->pad);
 	if (ret)
 		goto err_destroy_mutex;
drivers/media/platform/arm/mali-c55/mali-c55-stats.c +1 -1
index a9c28b090b2a..a9172781925c 100644
@@ -275,7 +275,7 @@ int mali_c55_register_stats(struct mali_c55 *mali_c55)
 	INIT_LIST_HEAD(&stats->buffers.queue);
 	spin_lock_init(&stats->buffers.lock);
 
-	stats->pad.flags = MEDIA_PAD_FL_SINK;
+	stats->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT;
 	ret = media_entity_pads_init(&stats->vdev.entity, 1, &stats->pad);
 	if (ret)
 		goto err_destroy_mutex;
Signature · 1 line
2.55.0