From patchwork Mon Oct 9 13:09:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 150100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1858409vqo; Mon, 9 Oct 2023 06:12:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8W7fKMGS1dJ01SVmduNbiweW+B3h8l+F/mD31qlW2rlcXvP8k6ADP5JpDc+MeFXhTZKW2 X-Received: by 2002:a17:90b:207:b0:263:ebab:a152 with SMTP id fy7-20020a17090b020700b00263ebaba152mr12311131pjb.19.1696857176395; Mon, 09 Oct 2023 06:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696857176; cv=none; d=google.com; s=arc-20160816; b=OUzKGvzOhWLbvutghC3OhcV3GCYD/k8yQByd47kkosXNo8lQ637YAwHUN7MVFJv8/n bKBx/Gat+5OUH+DjyG6dHIjRdm7P3rjETSJJqSqZ64UJ+Dmr7fkHZsw2Bx2VlWO1pObY TXf8/gkXrfRYBa5kg2Xr/6B3R6NhLyNY65XR0RLm7jqqZVAHzk5kf5J6s1duH5ZqXhmu 6JHRuiZywh9wYBt8dIbk0HUosKwU5Aa9mnDd9Ce95eguyh6ThvmlLsVn/qanJJiY5qqx CS/F7bkOJLOS9qHW5YcOx3VGzIN1i3LEglNy3a8u36QocqoR349CDMTlUZ13dzTug/Tf Syxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=07dWCB21kyjDiChID1v5HFl8K/TwWhxZIuKPCitG0vg=; fh=6xb4dRkd2+1fqSC803o7QgwwC4DGCN1bJaIcF3oxTbc=; b=rNhdL7+2irMm3r6D0JFOfK3FI8HVIy92tjgSyxOtMxJOZjVG/BWEffGNM8VQSpYrKG /T0yL3pfP1vcW8JTnLLTFLq+g9EcJD2h0Vl19r+HnRzXpkoLmtTFyma9iB2cIvUda+PQ Hkyq3EKs1zxHoGtf0KQf8c0zZ12Vnl43+jj9FWm6PhNFey6jBaeH1zFYwSGAwl8VPOzE zoCcO79qWD4nbRnV4fU7IT8MQDQHhCYXr6JxwkozEcVvUvyFl87cjS0RUEhtAWV1SWo/ SyMrKsiCYBafOyzYuiXaL4LdYt6hAI3kXCAmt9r2TALSCygfuo/MOjLdU61D4qLMIlzs b9/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BGuXCaK5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id na4-20020a17090b4c0400b00263c23a5693si10293062pjb.13.2023.10.09.06.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 06:12:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BGuXCaK5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 340748036866; Mon, 9 Oct 2023 06:12:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376919AbjJINKr (ORCPT + 18 others); Mon, 9 Oct 2023 09:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376788AbjJINKM (ORCPT ); Mon, 9 Oct 2023 09:10:12 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E137DC6; Mon, 9 Oct 2023 06:10:09 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 399D9wB3067976; Mon, 9 Oct 2023 08:09:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1696856998; bh=07dWCB21kyjDiChID1v5HFl8K/TwWhxZIuKPCitG0vg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BGuXCaK51VjDHP+GrftwE208jXP/YXXokTN3CL5Nv0OA+ByloTrnkragHLsYzJKDp oQWn1+VwYApYxSt69aqEmKu6Eq4JhImCu7l4AoD41z+wH/Orn3prUtFEMJbiNwfNm+ IPzh4pQ0t4qxLGzIepgLroSmmGoAaCD/x+LX3/xg= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 399D9weH071560 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Oct 2023 08:09:58 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 9 Oct 2023 08:09:58 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 9 Oct 2023 08:09:58 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 399D9vHh055692; Mon, 9 Oct 2023 08:09:58 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Tomi Valkeinen CC: , , , , Laurent Pinchart , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , , , Martyn Welch , Julien Massot Subject: [PATCH v10 11/13] media: cadence: csi2rx: Add link validation Date: Mon, 9 Oct 2023 18:39:37 +0530 Message-ID: <20231009-upstream_csi-v10-11-330aaed24c5d@ti.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009-upstream_csi-v10-0-330aaed24c5d@ti.com> References: <20231009-upstream_csi-v10-0-330aaed24c5d@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1569; i=j-luthra@ti.com; h=from:subject:message-id; bh=zo2hhYXbGio5ee2AnO4qGHe/0axDO9Ru33qV+Q96O/g=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBlI/sujDKPDTZgS8DjBKPkV3nZaRwdBaRViIeP5 xP8SJiUx7OJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZSP7LgAKCRBD3pH5JJpx RXWAEAC0/lEKXqIXdPmkqGm2QKz7hgG6egceWWJTskc/AhBUncWgdWa1OPpu/WUq1gj2ZIahjqq 9Igkyu7Skk5cwW5nCdRn4PuADw4AX0Yt4gJ6WiOPh2knVYbavEjRalWfIkfb+I1DoQd4JvIxYUE Wwr4Y6eOi8dtYR4cOJuWRZ0uhq+XpO4i7ipEjYhUcfKFkY8K3RhvmBvkp+15AiMOlezbAgZeNcw fhR1859Gtv0ppmK7qISpVVDj4pjjgkMYr708y67uyz0RRpTLCQ60Fcge5pXpGCmaHIMUx9MZAih Nh5qAoQtv3kHmXsUswMvhtaGK/C7IzD1kza8b0ZguOWqtPnRKWgA5oYLXOQjEwGV8yd4PIzwVuy IaamnFjJVsushLfEFrPDuPcRpYS0Ai73SE0n2Iul0wnz6y2X19+j8QvXpPX3mODBUAILXtBXQRD opRpKrsRl56Rdv1nDdI1/xXfY82/DGefzjVdR6l9wEp/v/0KSc8U2y5SEabe8FatILDnPDGdQcR 1bj47PpVA67K8S7FW0wY8WiKZ9jKJ0yXPdY8Gpp64Z6/0aLIn55pkxEvfOVX0IvTGN3wvLsTkET wTUCNQ8PQ8/rZOBbC6CKZCVUq7MUMIy9BP9Zsl5QS4dpcJmrImUhrwhwVNNC3eJOgQtMZ97lq56 KRtvmIFgHqiVIJg== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 06:12:38 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779283710686821625 X-GMAIL-MSGID: 1779283710686821625 From: Pratyush Yadav Add media link validation to make sure incorrectly configured pipelines are caught. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra --- drivers/media/platform/cadence/cdns-csi2rx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index d0c2a5b3d0d5..889f4fbbafb3 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -453,6 +453,10 @@ static const struct v4l2_subdev_ops csi2rx_subdev_ops = { .pad = &csi2rx_pad_ops, }; +static const struct media_entity_operations csi2rx_media_ops = { + .link_validate = v4l2_subdev_link_validate, +}; + static int csi2rx_async_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *s_subdev, struct v4l2_async_connection *asd) @@ -669,6 +673,7 @@ static int csi2rx_probe(struct platform_device *pdev) for (i = CSI2RX_PAD_SOURCE_STREAM0; i < CSI2RX_PAD_MAX; i++) csi2rx->pads[i].flags = MEDIA_PAD_FL_SOURCE; csi2rx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + csi2rx->subdev.entity.ops = &csi2rx_media_ops; ret = media_entity_pads_init(&csi2rx->subdev.entity, CSI2RX_PAD_MAX, csi2rx->pads);