linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] media: rcar-vin: Allow independent VIN link enablement
@ 2018-12-25 23:27 Steve Longerbeam
  2018-12-27  0:51 ` Niklas Söderlund
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Longerbeam @ 2018-12-25 23:27 UTC (permalink / raw)
  To: linux-media
  Cc: Steve Longerbeam, Niklas Söderlund, Mauro Carvalho Chehab,
	open list:MEDIA DRIVERS FOR RENESAS - VIN, open list

There is a block of code in rvin_group_link_notify() that prevents
enabling a link to a VIN node if any entity in the media graph is
in use. This prevents enabling a VIN link even if there is an in-use
entity somewhere in the graph that is independent of the link's
pipeline.

For example, the code block will prevent enabling a link from
the first rcar-csi2 receiver to a VIN node even if there is an
enabled link somewhere far upstream on the second independent
rcar-csi2 receiver pipeline.

If this code block is meant to prevent modifying a link if the
link is actively involved in streaming, there is already such a
check in __media_entity_setup_link() that verifies the stream_count
of the link's source and sink entities are both zero.

Remove the code block so that VIN node links can be enabled even if
there are other independent in-use entities.

Fixes: c0cc5aef31 ("media: rcar-vin: add link notify for Gen3")

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
---
 drivers/media/platform/rcar-vin/rcar-core.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index f0719ce24b97..b2c9a876969e 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -116,7 +116,6 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags,
 						struct rvin_group, mdev);
 	unsigned int master_id, channel, mask_new, i;
 	unsigned int mask = ~0;
-	struct media_entity *entity;
 	struct video_device *vdev;
 	struct media_pad *csi_pad;
 	struct rvin_dev *vin = NULL;
@@ -131,11 +130,6 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags,
 	    !is_media_entity_v4l2_video_device(link->sink->entity))
 		return 0;
 
-	/* If any entity is in use don't allow link changes. */
-	media_device_for_each_entity(entity, &group->mdev)
-		if (entity->use_count)
-			return -EBUSY;
-
 	mutex_lock(&group->lock);
 
 	/* Find the master VIN that controls the routes. */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-05  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-25 23:27 [RFC PATCH] media: rcar-vin: Allow independent VIN link enablement Steve Longerbeam
2018-12-27  0:51 ` Niklas Söderlund
2018-12-29 23:37   ` Steve Longerbeam
2019-01-05  0:48     ` Steve Longerbeam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).