Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5061692imu; Tue, 25 Dec 2018 16:51:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN4/oih34dyyW5AQE/+jHIAH9Q3rtJjyZaephrh2D5nsIT4ehNlyDdhH0lIMohk/Slj7sJq3 X-Received: by 2002:a63:9843:: with SMTP id l3mr16990444pgo.413.1545785502300; Tue, 25 Dec 2018 16:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545785502; cv=none; d=google.com; s=arc-20160816; b=OToUlP0Dh4vGDCyeCPj0E+rEoJ8OgYKve1019OfFkfDvnB6hc9KFrXbRjR4BIRIOCd KGYPVfQxX9JQyms27FtuZKopUoxjYfA4HFL2uOnrBx3HX+mbKxDGDZOjKWAoLf+56fvB gYAA7m4AxKgEbWcFn1ZJ8xnUNMO5QUf/AZrr9ViL6xAK6CSsOxyCZqIeXb0ELxxBxRrR oXSVt2xHSAqRWwFfgaKHvfCKrcmtk8pERXQ656P7EyYx1uJtaJNY2Dqb8+jOP5Yxh68J 2aIPOari/qBjlxZ/VFUiM2BKaTa8CS0BohrFSc9qLdSCrXMk/k8eonfp0i7SY1jdCh+x P2EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6ZAriIxlYoeqP9IEVh5Nvz3X8xyHhiwRf4UwJ49BmUM=; b=ruK6uCn9xB5OdLqIyeqWAeTU0jCAGnwNhu+9AJVZznNZOr3fD9Ft7WLWz4oyjtXqdR 2mCNFVf5Sm2JiL6T446js7ZHNfSASAWYwF+WzFlikNAOO/bo/bReD8zLKdJ+es4Qeh+P 9JxnbDMBlT02tZ8m1GeEOxoYHLZ2TbeacLg9t7mT/JmTd1q6oZ6CHcXncho96TQlaGki GifrIz5YZ+n/4kupMT/q2zNjO1MXPM4g54bAE7nbRwAu7P6DDig6QIjF9iSR/cYNKMq+ ioqNE8hCWDSAcsw0g2O9mbp/PyIGIGKP6VDFzR3d4z2fVoKJeFgeybSdhdWOoQUH8vSO OxGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQDZVG5C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si30128930plv.56.2018.12.25.16.51.27; Tue, 25 Dec 2018 16:51:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQDZVG5C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728662AbeLYX1f (ORCPT + 99 others); Tue, 25 Dec 2018 18:27:35 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33197 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728642AbeLYX1f (ORCPT ); Tue, 25 Dec 2018 18:27:35 -0500 Received: by mail-pf1-f194.google.com with SMTP id c123so7165019pfb.0; Tue, 25 Dec 2018 15:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6ZAriIxlYoeqP9IEVh5Nvz3X8xyHhiwRf4UwJ49BmUM=; b=LQDZVG5C26bXFU/pluou5yVmXbcD/D5Y9fhBSb6z8y3y+YE7BUsmwIyNegRQypOGgK 6FutmvBZb6OmzSrMoTnHsoFjp+6S+UoXNOB1E/lkO0/cjXcyZmZ/UBN4Qv/TawD3iPPw dtDdIiOsnPAwf1T2SRDcSXnVlmDV1vMCKmQc1KNCfkjSw45WxeZUD2BFXUGxfQaeNGNK L3E/H4XwY6Pb6r6zjKr3NaBL+WrXwiKUJBvTnn6PKWFbMiKLN55vU4OqdACvoVDbRTB2 y/VIKRqZgj0EZ0h5MsO2NtolfLFWSz1cNzvGwqYG1EH/0Wr5GkLCmONJ5jRmWXwy5p/w DC9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6ZAriIxlYoeqP9IEVh5Nvz3X8xyHhiwRf4UwJ49BmUM=; b=Iwu8paCQQxCHis14g8HRCVTzWiWlaGGD73gtNESaDGyMqOd3xCjVipbMzEHjHuF/5K HtzlhWByYD36f3wmHlAkOQU1QTS7TKl5Er5QXZYypIn/J4+VpO5rUSq6wT+RTSKXUKsI UoP42bnEy5K77rJL76kbde2bDEc2iGhO8ySc94sr2CHOWciiUG5jVmlwYkaxRUaNydho yZSeg8j3cakToLdHuMPW94fg9rT5Al0OwCrAoqhIGHbMaBnydPrwWkPYVmMhOJIPjNMB MgUtHEInQnq3CiDQeQI7F+ea1BVfgTWLNIIyFIH4OkP8SK0ehOAvSwNNXvdNuDgmRo2w d+wA== X-Gm-Message-State: AJcUukc1hvX0lZaFV8mxtJyzTq2K1jZpI0D7kOZvetp2ICKOgZJb5bZo faN4HLqHqE9786NLMyqhHorNWGRu X-Received: by 2002:a62:59c9:: with SMTP id k70mr18021789pfj.243.1545780453624; Tue, 25 Dec 2018 15:27:33 -0800 (PST) Received: from mappy.world.mentorg.com (c-98-210-181-167.hsd1.ca.comcast.net. [98.210.181.167]) by smtp.gmail.com with ESMTPSA id y84sm67027552pfb.81.2018.12.25.15.27.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Dec 2018 15:27:32 -0800 (PST) From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Mauro Carvalho Chehab , linux-renesas-soc@vger.kernel.org (open list:MEDIA DRIVERS FOR RENESAS - VIN), linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH] media: rcar-vin: Allow independent VIN link enablement Date: Tue, 25 Dec 2018 15:27:25 -0800 Message-Id: <20181225232725.15935-1-slongerbeam@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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